pax_global_header00006660000000000000000000000064135140447470014523gustar00rootroot0000000000000052 comment=cdbf63b97bb46f8093b42b4b991617330bf655f8 qt5dxcb-plugin-5.0.1/000077500000000000000000000000001351404474700143745ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/.clog.toml000066400000000000000000000002261351404474700162730ustar00rootroot00000000000000[clog] repository = "https://github.com/linuxdeepin/qt5dxcb-plugin" from-latest-tag = true changelog = "CHANGELOG.md" [sections] Others = ["chore"] qt5dxcb-plugin-5.0.1/.gitignore000066400000000000000000000005461351404474700163710ustar00rootroot00000000000000*.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 qt5dxcb-plugin-5.0.1/CHANGELOG.md000066400000000000000000000622741351404474700162200ustar00rootroot00000000000000 ## 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)) qt5dxcb-plugin-5.0.1/LICENSE000066400000000000000000001045141351404474700154060ustar00rootroot00000000000000 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. 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 . qt5dxcb-plugin-5.0.1/README.md000066400000000000000000000047251351404474700156630ustar00rootroot00000000000000# qt5dxcb-plugin qt5dxcb-plugin 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: ``` $ cd qt5dxcb-plugin $ 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: * [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) * [IRC Channel](https://webchat.freenode.net/?channels=deepin) * [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). (English) * [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) (中文) ## License qt5dxcb-plugin is licensed under [GPLv3](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 重定向窗口绘制的内容qt5dxcb-plugin-5.0.1/clog.toml000066400000000000000000000001661351404474700162200ustar00rootroot00000000000000[clog] repository = "https://github.com/linuxdeepin/qt5dxcb-plugin" from-latest-tag = true changelog = "CHANGELOG.md" qt5dxcb-plugin-5.0.1/debian/000077500000000000000000000000001351404474700156165ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/debian/changelog000066400000000000000000000002331351404474700174660ustar00rootroot00000000000000qt5dxcb-plugin (1.0.0-1) unstable; urgency=medium * Initial release -- Deepin Packages Builder Tue, 08 Nov 2016 15:10:02 +0800 qt5dxcb-plugin-5.0.1/debian/compat000066400000000000000000000000021351404474700170140ustar00rootroot000000000000009 qt5dxcb-plugin-5.0.1/debian/control000066400000000000000000000015401351404474700172210ustar00rootroot00000000000000Source: qt5dxcb-plugin 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, libfreetype6-dev, libglib2.0-dev, libxcb-damage0-dev, libxcb-composite0-dev, libcairo2-dev Standards-Version: 3.9.8 Package: qt5dxcb-plugin Architecture: any Provides: libqt5dxcb-plugin Conflicts: libqt5dxcb-plugin Breaks:dde-qt5integration (<< 0.2.8.1) Depends: ${shlibs:Depends}, ${misc:Depends} Description: Qt platform plugins Qt platform plugins for DDE. qt5dxcb-plugin-5.0.1/debian/copyright000066400000000000000000000017441351404474700175570ustar00rootroot00000000000000Format: 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". qt5dxcb-plugin-5.0.1/debian/rules000077500000000000000000000002051351404474700166730ustar00rootroot00000000000000#!/usr/bin/make -f export QT_SELECT=5 %: dh $@ override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info qt5dxcb-plugin-5.0.1/debian/source/000077500000000000000000000000001351404474700171165ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/debian/source/format000066400000000000000000000000151351404474700203250ustar00rootroot000000000000003.0 (native) qt5dxcb-plugin-5.0.1/platformplugin/000077500000000000000000000000001351404474700174375ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/README.md000066400000000000000000000000521351404474700207130ustar00rootroot00000000000000# qt5dxcb-plugin The Qt5 platforms plugin qt5dxcb-plugin-5.0.1/platformplugin/cursors/000077500000000000000000000000001351404474700211375ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/cursors/README000066400000000000000000000002131351404474700220130ustar00rootroot00000000000000All images under this directory are made by Wuhan Deepin Technology Co., Ltd. Licensed under GNU GENERAL PUBLIC LICENSE Version 3 or later.qt5dxcb-plugin-5.0.1/platformplugin/cursors/all-scroll.png000066400000000000000000000047701351404474700237210ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/bottom_side.png000066400000000000000000000034551351404474700241640ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/crossed_circle.png000066400000000000000000000036171351404474700246370ustar00rootroot00000000000000PNG  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 left_ptr_watch_0001.png question_arrow.png sb_h_double_arrow.png sb_v_double_arrow.png qt5dxcb-plugin-5.0.1/platformplugin/cursors/dnd-copy.png000066400000000000000000000052501351404474700233640ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/grabbing.png000066400000000000000000000040751351404474700234260ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/hand1.png000066400000000000000000000053431351404474700226450ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/left_ptr_watch_0001.png000066400000000000000000000045031351404474700253140ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/question_arrow.png000066400000000000000000000043121351404474700247260ustar00rootroot00000000000000PNG  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`qt5dxcb-plugin-5.0.1/platformplugin/cursors/sb_h_double_arrow.png000066400000000000000000000037171351404474700253340ustar00rootroot00000000000000PNG  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. */ #ifndef DFOREIGNPLATFORMWINDOW_H #define DFOREIGNPLATFORMWINDOW_H #include "global.h" #include #ifdef Q_OS_LINUX #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; #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 qt5dxcb-plugin-5.0.1/platformplugin/dforeignplatformwindow_x11.cpp000066400000000000000000000347131351404474700254360ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #include "dforeignplatformwindow.h" #include "dplatformintegration.h" #include "global.h" #include "utility.h" #include "qxcbconnection.h" #include "qxcbscreen.h" #include #include #include #include #include DPP_BEGIN_NAMESPACE 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; } QRect DForeignPlatformWindow::geometry() const { xcb_connection_t *conn = DPlatformIntegration::xcbConnection()->xcb_connection(); xcb_get_geometry_reply_t *geomReply = xcb_get_geometry_reply(conn, xcb_get_geometry(conn, m_window), 0); if (!geomReply) return QRect(); xcb_translate_coordinates_reply_t *translateReply = xcb_translate_coordinates_reply(conn, xcb_translate_coordinates(conn, m_window, DPlatformIntegration::xcbConnection()->rootWindow(), 0, 0), 0); if (!translateReply) { free(geomReply); return QRect(); } const QRect result(QPoint(translateReply->dst_x, translateReply->dst_y), QSize(geomReply->width, geomReply->height)); free(translateReply); // 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 return result.marginsRemoved(QMargins(data[0], data[2], data[1], data[3])); } return result; } #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 (!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 = parent() ? 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::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { if (propertyDeleted) return; return updateWindowState(); } else if (event->atom == atom(QXcbAtom::_NET_FRAME_EXTENTS)) { m_dirtyFrameMargins = true; } else if (event->atom == atom(QXcbAtom::_NET_WM_WINDOW_TYPE)) { return updateWindowTypes(); } else if (event->atom == Utility::internAtom("_NET_WM_DESKTOP")) { return updateWmDesktop(); } else if (event->atom == QXcbAtom::_NET_WM_NAME) { return updateTitle(); } else if (event->atom == QXcbAtom::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::_NET_WM_NAME), atom(QXcbAtom::UTF8_STRING), 0, 1024), NULL); if (wm_name && wm_name->format == 8 && wm_name->type == atom(QXcbAtom::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::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::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() { QXcbWindowFunctions::WmWindowTypes window_types = wmWindowTypes(); Qt::WindowFlags window_flags = 0; if (window_types & QXcbWindowFunctions::Normal) window_flags |= Qt::Window; else if (window_types & QXcbWindowFunctions::Desktop) window_flags |= Qt::Desktop; else if (window_types & QXcbWindowFunctions::Dialog) window_flags |= Qt::Dialog; else if (window_types & QXcbWindowFunctions::Utility) window_flags |= Qt::Tool; else if (window_types & QXcbWindowFunctions::Tooltip) window_flags |= Qt::ToolTip; else if (window_types & QXcbWindowFunctions::Splash) window_flags |= Qt::SplashScreen; else 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::_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 qt5dxcb-plugin-5.0.1/platformplugin/dframewindow.cpp000066400000000000000000000754711351404474700226470ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 #ifdef Q_OS_LINUX #include #endif DPP_BEGIN_NAMESPACE 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_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_image_surface_create_for_data(image.bits(), format, image.width(), image.height(), image.bytesPerLine()); cairo_t *cr = cairo_create(surface); cairo_surface_mark_dirty(nativeWindowXSurface); cairo_set_source_rgb(cr, 0, 255, 0); cairo_set_source_surface(cr, nativeWindowXSurface, offset.x(), offset.y()); 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_move_to(cr, e.x, e.y); break; case QPainterPath::LineToElement: clip = true; 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_curve_to(cr, e.x, e.y, p2.x, p2.y, p3.x, p3.y); break; } default: break; } } if (clip) { 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_rectangle(cr, rect.x + offset.x(), rect.y + offset.y(), rect.width, rect.height); cairo_fill(cr); } } else { cairo_paint(cr); // draw shadow drawShadowTo(&image); d_func()->flushArea = QRect(QPoint(0, 0), d_func()->size); } cairo_destroy(cr); 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_xlib_surface_set_drawable(nativeWindowXSurface, nativeWindowXPixmap, width, height); } else { Display *display = (Display*)DPlatformIntegration::xcbConnection()->xlib_display(); XWindowAttributes attr; XGetWindowAttributes(display, winId, &attr); //###(zccrs): 只能使用cairo的xlib接口,使用xcb接口会导致从创建的surface中读取内容时不正确 nativeWindowXSurface = 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_xlib_surface_get_width(nativeWindowXSurface); int height = 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 qt5dxcb-plugin-5.0.1/platformplugin/dframewindow.h000066400000000000000000000123251351404474700223010ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 qt5dxcb-plugin-5.0.1/platformplugin/dhighdpi.cpp000066400000000000000000000017431351404474700217300ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * Author: zccrs * * Maintainer: zccrs * * 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 * 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 . */ #include "dhighdpi.h" #include QPointF DHighDpi::fromNativePixels(const QPointF &pixelPoint, const QWindow *window) { return QHighDpi::fromNativePixels(pixelPoint, window); } qt5dxcb-plugin-5.0.1/platformplugin/dhighdpi.h000066400000000000000000000020101351404474700213610ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * Author: zccrs * * Maintainer: zccrs * * 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 * 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 . */ #ifndef DHIGHDPI_H #define DHIGHDPI_H #include QT_BEGIN_NAMESPACE class QWindow; QT_END_NAMESPACE class DHighDpi { public: static QPointF fromNativePixels(const QPointF &pixelPoint, const QWindow *window); }; #endif // DHIGHDPI_H qt5dxcb-plugin-5.0.1/platformplugin/dnativesettings.cpp000066400000000000000000000306641351404474700233670ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. * * Author: zccrs * * Maintainer: zccrs * * 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 * 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 . */ #include "dnativesettings.h" #ifdef Q_OS_LINUX #include "dxcbxsettings.h" #endif #include "dplatformintegration.h" #include #include #include #define VALID_PROPERTIES "validProperties" DPP_BEGIN_NAMESPACE QHash DNativeSettings::mapped; /* * 通过覆盖QObject的qt_metacall虚函数,检测base object中自定义的属性列表,将xwindow对应的设置和object对象中的属性绑定到一起使用 * 将对象通过property/setProperty调用对属性的读写操作转为对xsetting的属性设 置 */ DNativeSettings::DNativeSettings(QObject *base, quint32 settingsWindow) : m_base(base) , m_objectBuilder(base->metaObject()) { if (mapped.value(base)) { qCritical() << "DNativeSettings: Native settings are already initialized for object:" << base; std::abort(); } mapped[base] = this; QByteArray settings_property; { // 获取base对象是否指定了native settings的域 // 默认情况下,native settings的值保存在窗口的_XSETTINGS_SETTINGS属性上 // 指定域后,会将native settings的值保存到指定的窗口属性。 // 将域的值转换成窗口属性时,会把 "/" 替换为 "_",如域:"/xxx/xxx" 转成窗口属性为:"_xxx_xxx" // 且所有字母转换为大写 int index = base->metaObject()->indexOfClassInfo("Domain"); if (index >= 0) { settings_property = QByteArray(base->metaObject()->classInfo(index).value()); settings_property = settings_property.toUpper(); settings_property.replace('/', '_'); } } // 当指定了窗口或窗口属性时,应当创建一个新的native settings if (settingsWindow || !settings_property.isEmpty()) { m_settings = new NativeSettings(settingsWindow, settings_property); } else { m_settings = DPlatformIntegration::instance()->xSettings(); } if (m_settings->initialized()) { init(); } } DNativeSettings::~DNativeSettings() { if (m_settings != DPlatformIntegration::instance()->xSettings(true)) { delete m_settings; } mapped.remove(m_base); if (m_metaObject) { free(m_metaObject); } } bool DNativeSettings::isValid() const { return m_settings->initialized(); } void DNativeSettings::init() { m_firstProperty = m_base->metaObject()->propertyOffset(); m_propertyCount = m_base->metaObject()->propertyCount() - m_base->metaObject()->superClass()->propertyCount(); // 用于记录属性是否有效的属性, 属性类型为64位整数,最多可用于记录64个属性的状态 m_flagPropertyIndex = m_base->metaObject()->indexOfProperty(VALID_PROPERTIES); qint64 validProperties = 0; QMetaObjectBuilder &ob = m_objectBuilder; ob.setFlags(ob.flags() | QMetaObjectBuilder::DynamicMetaObject); // 先删除所有的属性,等待重构 while (ob.propertyCount() > 0) { ob.removeProperty(0); } QVector propertySignalIndex; propertySignalIndex.reserve(m_propertyCount); for (int i = 0; i < m_propertyCount; ++i) { int index = i + m_firstProperty; const QMetaProperty &mp = m_base->metaObject()->property(index); if (mp.hasNotifySignal()) { propertySignalIndex << mp.notifySignalIndex(); } // 跳过特殊属性 if (index == m_flagPropertyIndex) { ob.addProperty(mp); continue; } if (m_settings->setting(mp.name()).isValid()) { validProperties |= (1 << i); } QMetaPropertyBuilder op; switch (mp.type()) { 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()); break; } if (op.isWritable()) { // 声明支持属性reset op.setResettable(true); } } { // 通过class info确定是否应该关联对象的信号 int index = m_base->metaObject()->indexOfClassInfo("SignalType"); if (index >= 0) { const QByteArray signals_value(m_base->metaObject()->classInfo(index).value()); // 如果base对象声明为信号的生产者,则应该将其产生的信号转发到native settings if (signals_value == "producer") { // 创建一个槽用于接收所有信号 m_relaySlotIndex = ob.addMethod("relaySlot(QByteArray,qint32,qint32)").index() + m_base->metaObject()->methodOffset(); } } } // 将属性状态设置给对象 m_base->setProperty(VALID_PROPERTIES, validProperties); m_propertySignalIndex = m_base->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); } } } int DNativeSettings::createProperty(const char *name, const char *) { // 清理旧数据 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(void *screen, const QByteArray &name, const QVariant &property, DNativeSettings *handle) { Q_UNUSED(screen) if (handle->m_propertySignalIndex >= 0) { handle->method(handle->m_propertySignalIndex).invoke(handle->m_base, Q_ARG(QByteArray, name), Q_ARG(QVariant, property)); } // 不要直接调用自己的indexOfProperty函数,属性不存在时会导致调用createProperty函数 int property_index = handle->m_objectBuilder.indexOfProperty(name.constData()); if (Q_UNLIKELY(property_index < 0)) { return; } if (handle->m_flagPropertyIndex >= 0) { 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(void *screen, const QByteArray &signal, qint32 data1, qint32 data2, DNativeSettings *handle) { Q_UNUSED(screen) // 根据不同的参数寻找对应的信号 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_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) { QVariant arg(signal_method.parameterType(0), _a[1]); // 获取参数1,获取参数2 data1 = arg.toInt(); } if (signal_method.parameterCount() > 1) { QVariant arg(signal_method.parameterType(1), _a[2]); 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 qt5dxcb-plugin-5.0.1/platformplugin/dnativesettings.h000066400000000000000000000044341351404474700230300ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. * * Author: zccrs * * Maintainer: zccrs * * 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 * 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 . */ #ifndef DNATIVESETTINGS_H #define DNATIVESETTINGS_H #include "global.h" #include #define protected public #include #undef protected #include DPP_BEGIN_NAMESPACE #ifdef Q_OS_LINUX class DXcbXSettings; typedef DXcbXSettings NativeSettings; #endif class DNativeSettings : public QAbstractDynamicMetaObject { public: explicit DNativeSettings(QObject *base, quint32 settingsWindow); ~DNativeSettings(); bool isValid() const; private: void init(); int createProperty(const char *, const char *) override; int metaCall(QMetaObject::Call, int _id, void **) override; bool isRelaySignal() const; static void onPropertyChanged(void *screen, const QByteArray &name, const QVariant &property, DNativeSettings *handle); static void onSignal(void *screen, 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; // 用于转发base对象产生的信号的槽,使用native settings的接口将其发送出去. 值为0时表示不转发base对象的所有信号 int m_relaySlotIndex = 0; NativeSettings *m_settings = nullptr; static QHash mapped; }; DPP_END_NAMESPACE #endif // DNATIVESETTINGS_H qt5dxcb-plugin-5.0.1/platformplugin/dnotitlebarwindowhelper.cpp000066400000000000000000000444621351404474700251140ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. * * Author: zccrs * * Maintainer: zccrs * * 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 * 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 . */ #include "dnotitlebarwindowhelper.h" #include "vtablehook.h" #include "utility.h" #include "dwmsupport.h" #include "dnativesettings.h" #include "dplatformintegration.h" #define protected public #include #undef protected #include #include #include #include #define _DEEPIN_SCISSOR_WINDOW "_DEEPIN_SCISSOR_WINDOW" Q_DECLARE_METATYPE(QPainterPath) DPP_BEGIN_NAMESPACE QHash DNoTitlebarWindowHelper::mapped; 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(); 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() { mapped.remove(qobject_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.toStringList(); 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.toStringList(); 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("shadowOffect"), qMakePair(0.0, 0.0))); } QColor DNoTitlebarWindowHelper::shadowColor() const { return qvariant_cast(property("shadowColor")); } 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("shadowOffect", 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::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->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->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::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 QVector &a = *(reinterpret_cast*>(&tmpV)); 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(); 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; } if (is_mouse_move && self->m_windowMoving) { updateMoveWindow(winId); } bool ret = VtableHook::callOriginalFun(w, &QWindow::event, event); if (is_mouse_move && !event->isAccepted()) { if (!self->m_windowMoving && self->isEnableSystemMove(winId)) { self->m_windowMoving = true; event->accept(); startMoveWindow(winId); } } 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->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 qt5dxcb-plugin-5.0.1/platformplugin/dnotitlebarwindowhelper.h000066400000000000000000000116271351404474700245560ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd. * * Author: zccrs * * Maintainer: zccrs * * 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 * 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 . */ #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(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; 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); signals: void themeChanged(); void windowRadiusChanged(); void borderWidthChanged(); void borderColorChanged(); void shadowRadiusChanged(); void shadowOffectChanged(); void shadowColorChanged(); 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 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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformbackingstore.cpp000066400000000000000000001502311351404474700245310ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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::_NET_WM_STATE)) { QXcbWindow::NetWmStates states = window->netWmStates(); ww->setProperty(netWmStates, (int)states); } } DPP_END_NAMESPACE #include "dplatformbackingstore.moc" qt5dxcb-plugin-5.0.1/platformplugin/dplatformbackingstore.h000066400000000000000000000144431351404474700242020ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformbackingstorehelper.cpp000066400000000000000000000170161351404474700257340ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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.setMatrix(QMatrix(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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformbackingstorehelper.h000066400000000000000000000030461351404474700253770ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformintegration.cpp000066400000000000000000001010351351404474700243770ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #include "dplatformintegration.h" #include "global.h" #include "dforeignplatformwindow.h" #include "vtablehook.h" #include "dwmsupport.h" #include "dnotitlebarwindowhelper.h" #include "dnativesettings.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 "dxcbxsettings.h" #include "qxcbscreen.h" #include "qxcbbackingstore.h" #include #include #include #endif #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #include #else #include #endif #include #include #include #include #include #include #define protected public #include #undef protected #include #include // 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") 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 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) #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() { #ifdef Q_OS_LINUX if (!m_eventFilter) return; qApp->removeNativeEventFilter(m_eventFilter); delete m_eventFilter; #endif #ifdef USE_NEW_IMPLEMENTING delete m_storeHelper; delete m_contextHelper; #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) { qDebug() << __FUNCTION__ << window << window->type() << 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; qDebug() << __FUNCTION__ << enable << window << window->type() << 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) { // 跟随object销毁 auto settings = new DNativeSettings(object, settingWindow); if (!settings->isValid()) { delete settings; return false; } return true; } void DPlatformIntegration::clearNativeSettings(quint32 settingWindow) { #ifdef Q_OS_LINUX DXcbXSettings::clearSettings(settingWindow); #endif } QPlatformWindow *DPlatformIntegration::createPlatformWindow(QWindow *window) const { qDebug() << __FUNCTION__ << window << window->type() << 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())); } // 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); } } bool isNoTitlebar = window->type() != Qt::Desktop && window->property(noTitlebar).toBool(); if (isNoTitlebar && DWMSupport::instance()->hasNoTitlebar()) { // 销毁旧的helper对象, 此处不用将mapped的值移除,后面会被覆盖 if (DNoTitlebarWindowHelper *helper = DNoTitlebarWindowHelper::mapped.value(window)) { helper->deleteLater(); } QPlatformWindow *w = DPlatformIntegrationParent::createPlatformWindow(window); Utility::setNoTitlebar(w->winId(), true); // 跟随窗口被销毁 Q_UNUSED(new DNoTitlebarWindowHelper(window, w->winId())) #ifdef Q_OS_LINUX Q_UNUSED(new WindowEventHook(static_cast(w), false)) #endif 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); } Q_UNUSED(new WindowEventHook(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 } return xw; } QPlatformBackingStore *DPlatformIntegration::createPlatformBackingStore(QWindow *window) const { qDebug() << __FUNCTION__ << window << window->type() << window->parent(); QPlatformBackingStore *store = DPlatformIntegrationParent::createPlatformBackingStore(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 = 0; 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 = 0; } QSettings settings(QSettings::IniFormat, QSettings::UserScope, "deepin", "qt-theme"); settings.setIniCodec("utf-8"); settings.beginGroup("Platform"); bool ok = false; disable_features = QPaintEngine::PaintEngineFeatures(settings.value("PaintEngineDisableFeatures").toByteArray().toInt(&ok, 16)); if (!ok) disable_features = 0; } 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(); 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; 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.byteCount()); 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 (!cursor && !xcb_cursor->m_gtkCursorThemeInitialized) { 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 = 0; 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; // set cursor size scale static bool xcursrSizeIsSet = qEnvironmentVariableIsSet("XCURSOR_SIZE"); if (!xcursrSizeIsSet) qputenv("XCURSOR_SIZE", QByteArray::number(24 * widget->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 } 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 static bool hookDragObjectEventFilter(QObject *drag, QObject *o, QEvent *e) { if (e->type() == QEvent::MouseMove) { return static_cast(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 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::XdndActionCopy); if (actions.testFlag(Qt::MoveAction)) support_actions << drag->atom(QXcbAtom::XdndActionMove); if (actions.testFlag(Qt::LinkAction)) support_actions << drag->atom(QXcbAtom::XdndActionLink); if (support_actions.size() < 2) return; xcb_change_property(drag->xcb_connection(), XCB_PROP_MODE_REPLACE, drag->connection()->clipboard()->m_owner, drag->atom(QXcbAtom::XdndActionList), XCB_ATOM_ATOM, sizeof(xcb_atom_t) * 8, support_actions.size(), support_actions.constData()); xcb_flush(drag->xcb_connection()); } 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 (qEnvironmentVariableIsSet("DXCB_FAKE_PLATFORM_NAME_XCB")) { *QGuiApplicationPrivate::platform_name = "xcb"; } qApp->setProperty("_d_isDxcb", true); QXcbIntegration::initialize(); #ifdef Q_OS_LINUX m_eventFilter = new XcbNativeEventFilter(defaultConnection()); 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 for (QScreen *s : qApp->screens()) { hookXcbCursor(s); } QObject::connect(qApp, &QGuiApplication::screenAdded, qApp, &hookXcbCursor); } 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()), &QObject::eventFilter, &hookDragObjectEventFilter); for (QScreen *s : qApp->screens()) { hookScreenGetWindow(s); } QObject::connect(qApp, &QGuiApplication::screenAdded, qApp, &hookScreenGetWindow); } #ifdef Q_OS_LINUX static void onXSettingsChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle) { Q_UNUSED(screen) 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; if (!m_xsettings) { auto xsettings = new DXcbXSettings(xcbConnection()->primaryVirtualDesktop()); const_cast(this)->m_xsettings = xsettings; // 注册回调,用于通知 QStyleHints 属性改变 xsettings->registerCallbackForProperty(XSETTINGS_CURSOR_BLINK_TIME, onXSettingsChanged, reinterpret_cast(CursorFlashTime)); xsettings->registerCallbackForProperty(XSETTINGS_CURSOR_BLINK, onXSettingsChanged, reinterpret_cast(CursorFlashTime)); } 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); } DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/dplatformintegration.h000066400000000000000000000067671351404474700240640ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #ifndef GENERICPLUGIN_H #define GENERICPLUGIN_H #include "global.h" #include #ifdef Q_OS_LINUX #include "qxcbintegration.h" typedef QXcbIntegration DPlatformIntegrationParent; #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 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); QPlatformWindow *createPlatformWindow(QWindow *window) 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() { return instance()->defaultConnection();} inline XcbNativeEventFilter *eventFilter() { return m_eventFilter;} bool enableCursorBlink() const; DXcbXSettings *xSettings(bool onlyExists = false) const; private: XcbNativeEventFilter *m_eventFilter = Q_NULLPTR; DXcbXSettings *m_xsettings = nullptr; #endif private: // handle the DFrameWindow modal blocked state bool isWindowBlockedHandle(QWindow *window, QWindow **blockingWindow); DPlatformBackingStoreHelper *m_storeHelper; DPlatformOpenGLContextHelper *m_contextHelper; }; DPP_END_NAMESPACE #endif // GENERICPLUGIN_H qt5dxcb-plugin-5.0.1/platformplugin/dplatformnativeinterfacehook.cpp000066400000000000000000000152341351404474700261110ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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) { if (function == setWmBlurWindowBackgroundArea) { return reinterpret_cast(&Utility::blurWindowBackground); } else if (function == setWmBlurWindowBackgroundPathList) { return reinterpret_cast(&Utility::blurWindowBackgroundByPaths); } else if (function == setWmBlurWindowBackgroundMaskImage) { return reinterpret_cast(&Utility::blurWindowBackgroundByImage); } else if (function == hasBlurWindow) { return reinterpret_cast(&DWMSupport::Global::hasBlurWindow); } else if (function == hasComposite) { return reinterpret_cast(&DWMSupport::Global::hasComposite); } else if (function == hasNoTitlebar) { return reinterpret_cast(&DWMSupport::Global::hasNoTitlebar); } else if (function == hasWindowAlpha) { return reinterpret_cast(&DWMSupport::Global::hasWindowAlpha); } else if (function == windowManagerName) { return reinterpret_cast(&DWMSupport::Global::windowManagerName); } else if (function == connectWindowManagerChangedSignal) { return reinterpret_cast(&DWMSupport::connectWindowManagerChangedSignal); } else if (function == connectHasBlurWindowChanged) { return reinterpret_cast(&DWMSupport::connectHasBlurWindowChanged); } else if (function == connectHasCompositeChanged) { return reinterpret_cast(&DWMSupport::connectHasCompositeChanged); } else if (function == connectHasNoTitlebarChanged) { return reinterpret_cast(&DWMSupport::connectHasNoTitlebarChanged); } else if (function == getWindows) { return reinterpret_cast(&Utility::getWindows); } else if (function == getCurrentWorkspaceWindows) { return reinterpret_cast(&Utility::getCurrentWorkspaceWindows); } else if (function == connectWindowListChanged) { return reinterpret_cast(&DWMSupport::connectWindowListChanged); } else if (function == setMWMFunctions) { return reinterpret_cast(&DWMSupport::setMWMFunctions); } else if (function == getMWMFunctions) { return reinterpret_cast(&DWMSupport::getMWMFunctions); } else if (function == setMWMDecorations) { return reinterpret_cast(&DWMSupport::setMWMDecorations); } else if (function == getMWMDecorations) { return reinterpret_cast(&DWMSupport::getMWMDecorations); } else if (function == connectWindowMotifWMHintsChanged) { return reinterpret_cast(&DWMSupport::connectWindowMotifWMHintsChanged); } else if (function == popupSystemWindowMenu) { return reinterpret_cast(&DWMSupport::popupSystemWindowMenu); } else if (function == setWindowProperty) { return reinterpret_cast(&DPlatformIntegration::setWindowProperty); } else if (function == pluginVersion) { return reinterpret_cast(&version); } else if (function == inputEventSourceDevice) { return reinterpret_cast(&_inputEventSourceDevice); } else if (function == createGroupWindow) { return reinterpret_cast(&Utility::createGroupWindow); } else if (function == destoryGroupWindow) { return reinterpret_cast(&Utility::destoryGroupWindow); } else if (function == setWindowGroup) { return reinterpret_cast(&Utility::setWindowGroup); } else if (function == clientLeader) { return reinterpret_cast(&Utility::clientLeader); } else if (function == enableDxcb) { return reinterpret_cast(&DPlatformIntegration::enableDxcb); } else if (function == isEnableDxcb) { return reinterpret_cast(&DPlatformIntegration::isEnableDxcb); } else if (function == setEnableNoTitlebar) { return reinterpret_cast(&DPlatformIntegration::setEnableNoTitlebar); } else if (function == isEnableNoTitlebar) { return reinterpret_cast(&DPlatformIntegration::isEnableNoTitlebar); } else if (function == buildNativeSettings) { return reinterpret_cast(&DPlatformIntegration::buildNativeSettings); } else if (function == clearNativeSettings) { return reinterpret_cast(&DPlatformIntegration::clearNativeSettings); } return nullptr; } thread_local QHash DPlatformNativeInterfaceHook::functionCache; QFunctionPointer DPlatformNativeInterfaceHook::platformFunction(QPlatformNativeInterface *interface, const QByteArray &function) { if (QFunctionPointer f = functionCache.value(function)) { return f; } QFunctionPointer f = getFunction(function); if (f) { functionCache.insert(function, f); return f; } #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) return static_cast(interface)->DPlatformNativeInterface::platformFunction(function); #endif return 0; } DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/dplatformnativeinterfacehook.h000066400000000000000000000022471351404474700255560ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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); static thread_local QHash functionCache; }; DPP_END_NAMESPACE #endif // DPLATFORMNATIVEINTERFACE_H qt5dxcb-plugin-5.0.1/platformplugin/dplatformopenglcontexthelper.cpp000066400000000000000000000132401351404474700261450ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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.setMatrix(QMatrix(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.setMatrix(QMatrix(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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformopenglcontexthelper.h000066400000000000000000000025761351404474700256240ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformwindowhelper.cpp000066400000000000000000001437541351404474700246010ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 #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::_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); } bool DPlatformWindowHelper::startSystemResize(const QPoint &pos, Qt::Corner corner) { return me()->m_frameWindow->handle()->startSystemResize(pos, corner); } 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: QWindowSystemInterface::handleWindowActivated(m_nativeWindow->window(), static_cast(event)->reason()); return true; case QEvent::WindowActivate: QWindowSystemInterface::handleWindowActivated(m_nativeWindow->window(), Qt::OtherFocusReason); 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(); e->l = e->w = m_nativeWindow->window()->mapFromGlobal(e->globalPos()); qApp->sendEvent(m_nativeWindow->window(), e); 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); e->p -= m_frameWindow->contentOffsetHint(); #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); e->l = e->w = m_frameWindow->mapFromGlobal(e->globalPos()); QGuiApplicationPrivate::setMouseEventSource(e, Qt::MouseEventSynthesizedByQt); m_frameWindow->mouseMoveEvent(e); 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) ev->mouseState |= Qt::MouseButton(Qt::MaxMouseButton + type); 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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformwindowhelper.h000066400000000000000000000134061351404474700242340ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #ifndef DPLATFORMWINDOWHELPER_H #define DPLATFORMWINDOWHELPER_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" #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); bool startSystemResize(const QPoint &pos, Qt::Corner corner); 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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformwindowhook.cpp000066400000000000000000000214041351404474700242450ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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->devicePixelRatio(); winp->maximumSize += marginSize / win->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 qt5dxcb-plugin-5.0.1/platformplugin/dplatformwindowhook.h000066400000000000000000000047151351404474700237200ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 qt5dxcb-plugin-5.0.1/platformplugin/dpp.json000066400000000000000000000000341351404474700211120ustar00rootroot00000000000000{ "Keys" : [ "dxcb" ] } qt5dxcb-plugin-5.0.1/platformplugin/dwmsupport.h000066400000000000000000000016471351404474700220440ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 qt5dxcb-plugin-5.0.1/platformplugin/dxcbwmsupport.cpp000066400000000000000000000356441351404474700231000ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #include "dxcbwmsupport.h" #include "dplatformintegration.h" #include "utility.h" #include "dframewindow.h" #include "qxcbconnection.h" #include "qxcbscreen.h" #include "qxcbwindow.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_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::_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::_NET_WM_NAME), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::UTF8_STRING), 0, 1024), NULL); if (windowManagerReply && windowManagerReply->format == 8 && windowManagerReply->type == DPlatformIntegration::xcbConnection()->atom(QXcbAtom::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")); updateNetWMAtoms(); updateRootWindowProperties(); updateHasComposite(); 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::_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(); } 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() { xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); xcb_get_selection_owner_cookie_t cookit = xcb_get_selection_owner(xcb_connection, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::_NET_WM_CM_S0)); xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(xcb_connection, cookit, NULL); if (!reply) return; bool 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)); if (m_hasScissorWindow == hasScissorWindow) return; m_hasScissorWindow = hasScissorWindow; emit hasScissorWindowChanged(m_hasScissorWindow); } 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::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; } 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 { return m_hasNoTitlebar; } bool DXcbWMSupport::hasScissorWindow() const { return m_hasScissorWindow; } bool DXcbWMSupport::hasWindowAlpha() const { // 窗管不支持混成时也等价于窗口visual不支持alpha通道 return m_hasComposite && getHasWindowAlpha(); } 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(); } QString DXcbWMSupport::Global::windowManagerName() { return DXcbWMSupport::instance()->windowManagerName(); } DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/dxcbwmsupport.h000066400000000000000000000122331351404474700225320ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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) 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 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 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; QString windowManagerName() const; QVector allWindow() const; signals: void windowManagerChanged(); void hasBlurWindowChanged(bool hasBlurWindow); void hasCompositeChanged(bool hasComposite); void hasNoTitlebarChanged(bool hasNoTitlebar); void hasScissorWindowChanged(bool hasScissorWindow); void windowListChanged(); void windowMotifWMHintsChanged(quint32 winId); protected: explicit DXcbWMSupport(); private: void updateWMName(bool emitSignal = true); void updateNetWMAtoms(); void updateRootWindowProperties(); void updateHasBlurWindow(); void updateHasComposite(); void updateHasNoTitlebar(); void updateHasScissorWindow(); 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; 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_no_titlebar = 0; xcb_atom_t _deepin_scissor_window = 0; QVector net_wm_atoms; QVector root_window_properties; friend class XcbNativeEventFilter; friend class Utility; }; DPP_END_NAMESPACE #endif // DXCBWMSUPPORT_H qt5dxcb-plugin-5.0.1/platformplugin/dxcbxsettings.cpp000066400000000000000000000642001351404474700230360ustar00rootroot00000000000000/**************************************************************************** ** ** 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$ ** ****************************************************************************/ #include "dxcbxsettings.h" #include "dplatformintegration.h" #include #include #include #include #include #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct Q_DECL_HIDDEN DStdFreeDeleter { 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) \ ) 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(QXcbVirtualDesktop *screen, 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(screen, 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(QXcbConnection *connection); ~DXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; DXcbConnectionGrabber::DXcbConnectionGrabber(QXcbConnection *connection) :m_connection(connection) { connection->grabServer(); } DXcbConnectionGrabber::~DXcbConnectionGrabber() { release(); } void DXcbConnectionGrabber::release() { if (m_connection) { m_connection->ungrabServer(); // 必须保证xserver立即处理此请求, 因为xcb是异步请求的 // 当前线程中可能还存在其它的xcb connection,如果在 // xcb_ungrab_server调用之后,且server收到请求之前 // 其它的connection请求并wait了xcb,将会导致当前进程阻塞 // 此xcb_ungrab_server的调用就无法到达xserver,于是就形成了死锁。 xcb_flush(m_connection->xcb_connection()); m_connection = 0; } } class Q_DECL_HIDDEN DXcbXSettingsPrivate { public: DXcbXSettingsPrivate(QXcbVirtualDesktop *screen, const QByteArray &property) : screen(screen) , initialized(false) { if (property.isEmpty()) { x_settings_atom = screen->connection()->atom(QXcbAtom::_XSETTINGS_SETTINGS); } else { x_settings_atom = screen->connection()->internAtom(property); } if (!_xsettings_notify_atom) { _xsettings_notify_atom = screen->connection()->internAtom("_XSETTINGS_SETTINGS_NOTIFY"); } if (!_xsettings_signal_atom) { _xsettings_signal_atom = screen->connection()->internAtom("_XSETTINGS_SETTINGS_SIGNAL"); } // init xsettings owner if (!_xsettings_owner) { QByteArray settings_atom_for_screen("_XSETTINGS_S"); settings_atom_for_screen.append(QByteArray::number(screen->number())); auto atom_reply = Q_XCB_REPLY(xcb_intern_atom, screen->xcb_connection(), true, settings_atom_for_screen.length(), settings_atom_for_screen.constData()); if (!atom_reply) return; xcb_atom_t selection_owner_atom = atom_reply->atom; auto selection_result = Q_XCB_REPLY(xcb_get_selection_owner, screen->xcb_connection(), selection_owner_atom); if (!selection_result) return; _xsettings_owner = selection_result->owner; 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(screen->xcb_connection(), selection_result->owner, event, event_mask); } } } QByteArray getSettings() { DXcbConnectionGrabber connectionGrabber(screen->connection()); Q_UNUSED(connectionGrabber) int offset = 0; QByteArray settings; while (1) { xcb_get_property_cookie_t cookie = xcb_get_property(screen->xcb_connection(), false, x_settings_window, x_settings_atom, screen->connection()->atom(QXcbAtom::_XSETTINGS_SETTINGS), offset/4, 8192); xcb_generic_error_t *error = nullptr; auto reply = xcb_get_property_reply(screen->xcb_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(screen->connection()); Q_UNUSED(connectionGrabber) xcb_change_property(screen->xcb_connection(), XCB_PROP_MODE_REPLACE, x_settings_window, x_settings_atom, screen->connection()->atom(QXcbAtom::_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(screen->xcb_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; 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); } } 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_ptr = (uint*)(xSettings.data() + 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_ptr; 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_ptr == 0) { return QByteArray(); } return xSettings; } void init(xcb_window_t setting_window, DXcbXSettings *object) { x_settings_window = setting_window; mapped.insertMulti(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(screen, name, value, last_change_serial)) { for (const auto &callback : callback_links) { callback.func(screen, name, value, callback.handle); } return true; } return false; } QXcbVirtualDesktop *screen; 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(QXcbVirtualDesktop *screen, const QByteArray &property) : DXcbXSettings(screen, 0, property) { } DXcbXSettings::DXcbXSettings(QXcbVirtualDesktop *screen, xcb_window_t setting_window, const QByteArray &property) : d_ptr(new DXcbXSettingsPrivate(screen, property)) { 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(DPlatformIntegration::xcbConnection()->primaryVirtualDesktop(), setting_window, property) { } DXcbXSettings::~DXcbXSettings() { DXcbXSettingsPrivate::mapped.remove(d_ptr->x_settings_window); delete d_ptr; d_ptr = 0; } 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; for (DXcbXSettingsSignalCallback cb : self->d_ptr->signal_callback_links) { // data32[2]为signal id xcb_atom_t signal = event->data.data32[2]; const QByteArray signal_string(DPlatformIntegration::xcbConnection()->atomName(signal)); cb.func(self->d_ptr->screen, signal_string, event->data.data32[3], event->data.data32[4], cb.handle); } } return true; } return false; } void DXcbXSettings::clearSettings(xcb_window_t setting_window) { if (DXcbXSettings *self = DXcbXSettingsPrivate::mapped.value(setting_window)) { xcb_delete_property(DPlatformIntegration::xcbConnection()->xcb_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->x_settings_window, d->x_settings_atom, signal, data1, data2); } void DXcbXSettings::emitSignal(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 = DPlatformIntegration::xcbConnection()->internAtom(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(DPlatformIntegration::xcbConnection()->xcb_connection(), 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); ++d->serial; // 更新属性 d->setSettings(d->depopulateSettings()); } void DXcbXSettings::registerCallback(DXcbXSettings::PropertyChangeFunc func, void *handle) { Q_D(DXcbXSettings); DXcbXSettingsCallback callback = { func, handle }; d->callback_links.push_back(callback); } DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/dxcbxsettings.h000066400000000000000000000074331351404474700225100ustar00rootroot00000000000000/**************************************************************************** ** ** 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 DXCBXSETTINGS_H #define DXCBXSETTINGS_H #include "qxcbscreen.h" #include "global.h" DPP_BEGIN_NAMESPACE class DXcbXSettingsPrivate; class DXcbXSettings { Q_DECLARE_PRIVATE(DXcbXSettings) public: DXcbXSettings(QXcbVirtualDesktop *screen, const QByteArray &property = QByteArray()); DXcbXSettings(QXcbVirtualDesktop *screen, xcb_window_t setting_window, const QByteArray &property = QByteArray()); DXcbXSettings(xcb_window_t setting_window, const QByteArray &property = QByteArray()); ~DXcbXSettings(); bool initialized() const; bool isEmpty() const; bool contains(const QByteArray &property) const; QVariant setting(const QByteArray &property) const; void setSetting(const QByteArray &property, const QVariant &value); typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, 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)(QXcbVirtualDesktop *screen, 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); static void emitSignal(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; }; DPP_END_NAMESPACE #endif // DXCBXSETTINGS_H qt5dxcb-plugin-5.0.1/platformplugin/global.h000066400000000000000000000070001351404474700210450ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #ifndef GLOBAL_H #define GLOBAL_H #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(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(clipPath); DEFINE_CONST_CHAR(frameMask); DEFINE_CONST_CHAR(frameMargins); DEFINE_CONST_CHAR(translucentBackground); 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); // functions DEFINE_CONST_CHAR(setWmBlurWindowBackgroundArea); DEFINE_CONST_CHAR(setWmBlurWindowBackgroundPathList); DEFINE_CONST_CHAR(setWmBlurWindowBackgroundMaskImage); DEFINE_CONST_CHAR(hasBlurWindow); DEFINE_CONST_CHAR(hasComposite); DEFINE_CONST_CHAR(hasNoTitlebar); DEFINE_CONST_CHAR(hasWindowAlpha); DEFINE_CONST_CHAR(windowManagerName); DEFINE_CONST_CHAR(connectWindowManagerChangedSignal); DEFINE_CONST_CHAR(connectHasBlurWindowChanged); DEFINE_CONST_CHAR(connectHasCompositeChanged); DEFINE_CONST_CHAR(connectHasNoTitlebarChanged); DEFINE_CONST_CHAR(getWindows); 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(setEnableNoTitlebar); DEFINE_CONST_CHAR(isEnableNoTitlebar); DEFINE_CONST_CHAR(buildNativeSettings); DEFINE_CONST_CHAR(clearNativeSettings); // others DEFINE_CONST_CHAR(WmWindowTypes); DEFINE_CONST_CHAR(WmNetDesktop); DEFINE_CONST_CHAR(WmClass); DEFINE_CONST_CHAR(ProcessId); enum DeviceType { UnknowDevice, TouchapdDevice, MouseDevice }; #endif // GLOBAL_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/000077500000000000000000000000001351404474700226125ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/000077500000000000000000000000001351404474700233335ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbbackingstore.h000066400000000000000000000060061351404474700270370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbclipboard.h000066400000000000000000000107321351404474700263240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbconnection.h000066400000000000000000000604541351404474700265320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbcursor.h000066400000000000000000000100341351404474700256750ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbdrag.h000066400000000000000000000132421351404474700253010ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbexport.h000066400000000000000000000042021351404474700257010ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbimage.h000066400000000000000000000052461351404474700254530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbintegration.h000066400000000000000000000121461351404474700267110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbkeyboard.h000066400000000000000000000115741351404474700261720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbmime.h000066400000000000000000000061641351404474700253200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbnativeinterface.h000066400000000000000000000156261351404474700275430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 &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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbobject.h000066400000000000000000000047101351404474700256320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbscreen.h000066400000000000000000000227061351404474700256500ustar00rootroot00000000000000/**************************************************************************** ** ** 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); } 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbsessionmanager.h000066400000000000000000000062711351404474700274060ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301740ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbvulkaninstance.h000066400000000000000000000056521351404474700274170ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbwindow.h000066400000000000000000000254571351404474700257060ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbwmsupport.h000066400000000000000000000047001351404474700264430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.0/qxcbxsettings.h000066400000000000000000000054221351404474700264150ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/000077500000000000000000000000001351404474700233345ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbbackingstore.h000066400000000000000000000060061351404474700270400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbclipboard.h000066400000000000000000000107321351404474700263250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbconnection.h000066400000000000000000000604541351404474700265330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbcursor.h000066400000000000000000000100341351404474700256760ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbdrag.h000066400000000000000000000134141351404474700253030ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbexport.h000066400000000000000000000042021351404474700257020ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbimage.h000066400000000000000000000052461351404474700254540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbintegration.h000066400000000000000000000121461351404474700267120ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbkeyboard.h000066400000000000000000000115741351404474700261730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbmime.h000066400000000000000000000061641351404474700253210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbnativeinterface.h000066400000000000000000000156261351404474700275440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 &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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbobject.h000066400000000000000000000047101351404474700256330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbscreen.h000066400000000000000000000227061351404474700256510ustar00rootroot00000000000000/**************************************************************************** ** ** 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); } 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbsessionmanager.h000066400000000000000000000062711351404474700274070ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301750ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbvulkaninstance.h000066400000000000000000000056521351404474700274200ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbwindow.h000066400000000000000000000254571351404474700257070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbwmsupport.h000066400000000000000000000047001351404474700264440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.10.1/qxcbxsettings.h000066400000000000000000000054221351404474700264160ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/000077500000000000000000000000001351404474700233345ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbbackingstore.h000066400000000000000000000060421351404474700270400ustar00rootroot00000000000000/**************************************************************************** ** ** 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; private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbclipboard.h000066400000000000000000000107321351404474700263250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbconnection.h000066400000000000000000000622461351404474700265340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbcursor.h000066400000000000000000000107011351404474700256770ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbdrag.h000066400000000000000000000134141351404474700253030ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbexport.h000066400000000000000000000042021351404474700257020ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbimage.h000066400000000000000000000053151351404474700254510ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbintegration.h000066400000000000000000000121461351404474700267120ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbkeyboard.h000066400000000000000000000131071351404474700261650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbmime.h000066400000000000000000000061641351404474700253210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbnativeinterface.h000066400000000000000000000160741351404474700275420ustar00rootroot00000000000000/**************************************************************************** ** ** 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 &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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbobject.h000066400000000000000000000047101351404474700256330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbscreen.h000066400000000000000000000227041351404474700256470ustar00rootroot00000000000000/**************************************************************************** ** ** 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); } 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbsessionmanager.h000066400000000000000000000062711351404474700274070ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301750ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbvulkaninstance.h000066400000000000000000000056521351404474700274200ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbwindow.h000066400000000000000000000262671351404474700257070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbwmsupport.h000066400000000000000000000047001351404474700264440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbxkbcommon.h000066400000000000000000000245721351404474700263720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.0/qxcbxsettings.h000066400000000000000000000054221351404474700264160ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/000077500000000000000000000000001351404474700233355ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbbackingstore.h000066400000000000000000000062701351404474700270440ustar00rootroot00000000000000/**************************************************************************** ** ** 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(QXcbConnection *c, size_t segmentSize = 1, void *shmInfo = nullptr); private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbclipboard.h000066400000000000000000000107321351404474700263260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbconnection.h000066400000000000000000000622501351404474700265300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbcursor.h000066400000000000000000000107011351404474700257000ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbdrag.h000066400000000000000000000133651351404474700253110ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbexport.h000066400000000000000000000042021351404474700257030ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbimage.h000066400000000000000000000053151351404474700254520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbintegration.h000066400000000000000000000121471351404474700267140ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbkeyboard.h000066400000000000000000000131071351404474700261660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbmime.h000066400000000000000000000060021351404474700253110ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbnativeinterface.h000066400000000000000000000160741351404474700275430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 &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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbobject.h000066400000000000000000000047101351404474700256340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbscreen.h000066400000000000000000000227041351404474700256500ustar00rootroot00000000000000/**************************************************************************** ** ** 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); } 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbsessionmanager.h000066400000000000000000000062711351404474700274100ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301760ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbvulkaninstance.h000066400000000000000000000056521351404474700274210ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbwindow.h000066400000000000000000000262671351404474700257100ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbwmsupport.h000066400000000000000000000047001351404474700264450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbxkbcommon.h000066400000000000000000000245721351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.1/qxcbxsettings.h000066400000000000000000000054221351404474700264170ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/000077500000000000000000000000001351404474700233365ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbbackingstore.h000066400000000000000000000062701351404474700270450ustar00rootroot00000000000000/**************************************************************************** ** ** 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(QXcbConnection *c, size_t segmentSize = 1, void *shmInfo = nullptr); private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbclipboard.h000066400000000000000000000107321351404474700263270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbconnection.h000066400000000000000000000626001351404474700265300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbcursor.h000066400000000000000000000107011351404474700257010ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbdrag.h000066400000000000000000000133651351404474700253120ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbexport.h000066400000000000000000000042021351404474700257040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbimage.h000066400000000000000000000053151351404474700254530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbintegration.h000066400000000000000000000121471351404474700267150ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbkeyboard.h000066400000000000000000000131071351404474700261670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbmime.h000066400000000000000000000060021351404474700253120ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbnativeinterface.h000066400000000000000000000160741351404474700275440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 &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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbobject.h000066400000000000000000000047101351404474700256350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbscreen.h000066400000000000000000000224631351404474700256530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbsessionmanager.h000066400000000000000000000062711351404474700274110ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301770ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbvulkaninstance.h000066400000000000000000000056521351404474700274220ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbwindow.h000066400000000000000000000262671351404474700257110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbwmsupport.h000066400000000000000000000047001351404474700264460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbxkbcommon.h000066400000000000000000000245721351404474700263740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.2/qxcbxsettings.h000066400000000000000000000054221351404474700264200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/000077500000000000000000000000001351404474700233375ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbbackingstore.h000066400000000000000000000062701351404474700270460ustar00rootroot00000000000000/**************************************************************************** ** ** 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(QXcbConnection *c, size_t segmentSize = 1, void *shmInfo = nullptr); private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbclipboard.h000066400000000000000000000107321351404474700263300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbconnection.h000066400000000000000000000627331351404474700265400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbcursor.h000066400000000000000000000107011351404474700257020ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbdrag.h000066400000000000000000000133651351404474700253130ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbexport.h000066400000000000000000000042021351404474700257050ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbimage.h000066400000000000000000000053151351404474700254540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbintegration.h000066400000000000000000000121471351404474700267160ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbkeyboard.h000066400000000000000000000131071351404474700261700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbmime.h000066400000000000000000000060021351404474700253130ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbnativeinterface.h000066400000000000000000000160741351404474700275450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 &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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbobject.h000066400000000000000000000047101351404474700256360ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbscreen.h000066400000000000000000000224311351404474700256470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbsessionmanager.h000066400000000000000000000062711351404474700274120ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700302000ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbvulkaninstance.h000066400000000000000000000056521351404474700274230ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbwindow.h000066400000000000000000000262671351404474700257120ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbwmsupport.h000066400000000000000000000047001351404474700264470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbxkbcommon.h000066400000000000000000000245721351404474700263750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.11.3/qxcbxsettings.h000066400000000000000000000054221351404474700264210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/000077500000000000000000000000001351404474700233355ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbatom.h000066400000000000000000000146461351404474700253370ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbbackingstore.h000066400000000000000000000101411351404474700270340ustar00rootroot00000000000000/**************************************************************************** ** ** 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: #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbclipboard.h000066400000000000000000000107201351404474700263230ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbconnection.h000066400000000000000000000365131351404474700265330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbconnection_basic.h000066400000000000000000000140261351404474700276670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbcursor.h000066400000000000000000000107011351404474700257000ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbdrag.h000066400000000000000000000143111351404474700253010ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbeventdispatcher.h000066400000000000000000000075351351404474700275660ustar00rootroot00000000000000/**************************************************************************** ** ** 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); private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbeventqueue.h000066400000000000000000000123231351404474700265530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbexport.h000066400000000000000000000042021351404474700257030ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbimage.h000066400000000000000000000053151351404474700254520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbintegration.h000066400000000000000000000122401351404474700267060ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbkeyboard.h000066400000000000000000000133521351404474700261700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbmime.h000066400000000000000000000060021351404474700253110ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbnativeinterface.h000066400000000000000000000152471351404474700275440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbobject.h000066400000000000000000000047101351404474700256340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbscreen.h000066400000000000000000000220261351404474700256450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbsessionmanager.h000066400000000000000000000062711351404474700274100ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbsystemtraytracker.h000066400000000000000000000061401351404474700301650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbvulkaninstance.h000066400000000000000000000054711351404474700274200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbwindow.h000066400000000000000000000257651351404474700257120ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbwmsupport.h000066400000000000000000000047001351404474700264450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbxkbcommon.h000066400000000000000000000245721351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.0/qxcbxsettings.h000066400000000000000000000054221351404474700264170ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/000077500000000000000000000000001351404474700233365ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbatom.h000066400000000000000000000146461351404474700253400ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbbackingstore.h000066400000000000000000000101011351404474700270310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbclipboard.h000066400000000000000000000124251351404474700263300ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbconnection.h000066400000000000000000000365661351404474700265440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbconnection_basic.h000066400000000000000000000140261351404474700276700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbcursor.h000066400000000000000000000107011351404474700257010ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbdrag.h000066400000000000000000000143111351404474700253020ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbeventdispatcher.h000066400000000000000000000074611351404474700275650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbeventqueue.h000066400000000000000000000123231351404474700265540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbexport.h000066400000000000000000000042021351404474700257040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbimage.h000066400000000000000000000053151351404474700254530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbintegration.h000066400000000000000000000122401351404474700267070ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbkeyboard.h000066400000000000000000000133521351404474700261710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbmime.h000066400000000000000000000060021351404474700253120ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbnativeinterface.h000066400000000000000000000152471351404474700275450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbobject.h000066400000000000000000000047101351404474700256350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbscreen.h000066400000000000000000000220431351404474700256450ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbsessionmanager.h000066400000000000000000000062711351404474700274110ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbsystemtraytracker.h000066400000000000000000000061401351404474700301660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbvulkaninstance.h000066400000000000000000000054711351404474700274210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbwindow.h000066400000000000000000000257071351404474700257070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbwmsupport.h000066400000000000000000000047001351404474700264460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbxkbcommon.h000066400000000000000000000245721351404474700263740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.1/qxcbxsettings.h000066400000000000000000000054221351404474700264200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/000077500000000000000000000000001351404474700233375ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbatom.h000066400000000000000000000146461351404474700253410ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbbackingstore.h000066400000000000000000000101011351404474700270320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbclipboard.h000066400000000000000000000124251351404474700263310ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbconnection.h000066400000000000000000000365661351404474700265450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbconnection_basic.h000066400000000000000000000140261351404474700276710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbcursor.h000066400000000000000000000107011351404474700257020ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbdrag.h000066400000000000000000000143111351404474700253030ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbeventdispatcher.h000066400000000000000000000074611351404474700275660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbeventqueue.h000066400000000000000000000126201351404474700265550ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbexport.h000066400000000000000000000042021351404474700257050ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbimage.h000066400000000000000000000053151351404474700254540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbintegration.h000066400000000000000000000122401351404474700267100ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbkeyboard.h000066400000000000000000000133521351404474700261720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbmime.h000066400000000000000000000060021351404474700253130ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbnativeinterface.h000066400000000000000000000152471351404474700275460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbobject.h000066400000000000000000000047101351404474700256360ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbscreen.h000066400000000000000000000220431351404474700256460ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbsessionmanager.h000066400000000000000000000062711351404474700274120ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbsystemtraytracker.h000066400000000000000000000061401351404474700301670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbvulkaninstance.h000066400000000000000000000054711351404474700274220ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbwindow.h000066400000000000000000000257071351404474700257100ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbwmsupport.h000066400000000000000000000047001351404474700264470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbxkbcommon.h000066400000000000000000000245721351404474700263750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.2/qxcbxsettings.h000066400000000000000000000054221351404474700264210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/000077500000000000000000000000001351404474700233405ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbatom.h000066400000000000000000000146461351404474700253420ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbbackingstore.h000066400000000000000000000101011351404474700270330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbclipboard.h000066400000000000000000000124251351404474700263320ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbconnection.h000066400000000000000000000370531351404474700265360ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbconnection_basic.h000066400000000000000000000140731351404474700276740ustar00rootroot00000000000000/**************************************************************************** ** ** 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; } 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbcursor.h000066400000000000000000000107011351404474700257030ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbdrag.h000066400000000000000000000143111351404474700253040ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbeventdispatcher.h000066400000000000000000000074611351404474700275670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbeventqueue.h000066400000000000000000000126201351404474700265560ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbexport.h000066400000000000000000000042021351404474700257060ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbimage.h000066400000000000000000000053151351404474700254550ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbintegration.h000066400000000000000000000121201351404474700267060ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbkeyboard.h000066400000000000000000000133521351404474700261730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbmime.h000066400000000000000000000060021351404474700253140ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbnativeinterface.h000066400000000000000000000152471351404474700275470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbobject.h000066400000000000000000000047101351404474700256370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbscreen.h000066400000000000000000000220431351404474700256470ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbsessionmanager.h000066400000000000000000000062711351404474700274130ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbsystemtraytracker.h000066400000000000000000000061401351404474700301700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbvulkaninstance.h000066400000000000000000000054711351404474700274230ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbwindow.h000066400000000000000000000257071351404474700257110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbwmsupport.h000066400000000000000000000047001351404474700264500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbxkbcommon.h000066400000000000000000000245721351404474700263760ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.12.3/qxcbxsettings.h000066400000000000000000000054221351404474700264220ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/000077500000000000000000000000001351404474700233365ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbatom.h000066400000000000000000000146461351404474700253400ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbbackingstore.h000066400000000000000000000101011351404474700270310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbclipboard.h000066400000000000000000000124711351404474700263310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbconnection.h000066400000000000000000000370111351404474700265260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 *) {} #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbconnection_basic.h000066400000000000000000000143001351404474700276630ustar00rootroot00000000000000/**************************************************************************** ** ** 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; #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbcursor.h000066400000000000000000000107011351404474700257010ustar00rootroot00000000000000/**************************************************************************** ** ** 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) 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbdrag.h000066400000000000000000000143111351404474700253020ustar00rootroot00000000000000/**************************************************************************** ** ** 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: 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbeventdispatcher.h000066400000000000000000000074611351404474700275650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbeventqueue.h000066400000000000000000000126201351404474700265540ustar00rootroot00000000000000/**************************************************************************** ** ** 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); 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbexport.h000066400000000000000000000042021351404474700257040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbimage.h000066400000000000000000000053151351404474700254530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbintegration.h000066400000000000000000000121201351404474700267040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbkeyboard.h000066400000000000000000000114711351404474700261710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbmime.h000066400000000000000000000060021351404474700253120ustar00rootroot00000000000000/**************************************************************************** ** ** 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, 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbnativeinterface.h000066400000000000000000000152471351404474700275450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbobject.h000066400000000000000000000047101351404474700256350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbscreen.h000066400000000000000000000220431351404474700256450ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbsessionmanager.h000066400000000000000000000062211351404474700274040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbsystemtraytracker.h000066400000000000000000000061401351404474700301660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbvulkaninstance.h000066400000000000000000000054711351404474700274210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbvulkanwindow.h000066400000000000000000000044661351404474700271270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbwindow.h000066400000000000000000000261531351404474700257030ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbwmsupport.h000066400000000000000000000047001351404474700264460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.13.0/qxcbxsettings.h000066400000000000000000000054221351404474700264200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/000077500000000000000000000000001351404474700232555ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/LICENSE000066400000000000000000001045051351404474700242670ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qglxintegration.h000066400000000000000000000066661351404474700266630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbbackingstore.h000066400000000000000000000055031351404474700267620ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbclipboard.h000066400000000000000000000107341351404474700262500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbconnection.h000066400000000000000000000456061351404474700264560ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbcursor.h000066400000000000000000000075421351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbdrag.h000066400000000000000000000126111351404474700252220ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbeglsurface.h000066400000000000000000000046151351404474700264320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbimage.h000066400000000000000000000053261351404474700253740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbintegration.h000066400000000000000000000106011351404474700266250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbkeyboard.h000066400000000000000000000111271351404474700261060ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbmime.h000066400000000000000000000062401351404474700252350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbnativeinterface.h000066400000000000000000000105031351404474700274520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbobject.h000066400000000000000000000047701351404474700255620ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbscreen.h000066400000000000000000000115451351404474700255710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbsessionmanager.h000066400000000000000000000063441351404474700273310ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbsystemtraytracker.h000066400000000000000000000062671351404474700301170ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbwindow.h000066400000000000000000000162311351404474700256160ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbwmsupport.h000066400000000000000000000047601351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxcbxsettings.h000066400000000000000000000054431351404474700263420ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.0/qxlibconvenience.h000066400000000000000000000043641351404474700267710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/000077500000000000000000000000001351404474700232565ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/LICENSE000066400000000000000000001045051351404474700242700ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qglxintegration.h000066400000000000000000000066661351404474700266640ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbbackingstore.h000066400000000000000000000054511351404474700267650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbclipboard.h000066400000000000000000000107341351404474700262510ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbconnection.h000066400000000000000000000462201351404474700264500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbcursor.h000066400000000000000000000075421351404474700256320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbdrag.h000066400000000000000000000126111351404474700252230ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbeglsurface.h000066400000000000000000000046151351404474700264330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbimage.h000066400000000000000000000053261351404474700253750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbintegration.h000066400000000000000000000106011351404474700266260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbkeyboard.h000066400000000000000000000111271351404474700261070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbmime.h000066400000000000000000000062401351404474700252360ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbnativeinterface.h000066400000000000000000000105031351404474700274530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbobject.h000066400000000000000000000047701351404474700255630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbscreen.h000066400000000000000000000115451351404474700255720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbsessionmanager.h000066400000000000000000000063441351404474700273320ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbsystemtraytracker.h000066400000000000000000000062671351404474700301200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbwindow.h000066400000000000000000000167051351404474700256250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbwmsupport.h000066400000000000000000000047601351404474700263740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxcbxsettings.h000066400000000000000000000054431351404474700263430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.1/qxlibconvenience.h000066400000000000000000000043641351404474700267720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/000077500000000000000000000000001351404474700232575ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/LICENSE000066400000000000000000001045051351404474700242710ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qglxintegration.h000066400000000000000000000066641351404474700266630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbbackingstore.h000066400000000000000000000054511351404474700267660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbclipboard.h000066400000000000000000000107341351404474700262520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbconnection.h000066400000000000000000000464571351404474700264650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbcursor.h000066400000000000000000000075421351404474700256330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbdrag.h000066400000000000000000000126111351404474700252240ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbeglsurface.h000066400000000000000000000046151351404474700264340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbexport.h000066400000000000000000000034561351404474700256370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbimage.h000066400000000000000000000053261351404474700253760ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbintegration.h000066400000000000000000000106011351404474700266270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbkeyboard.h000066400000000000000000000110211351404474700261010ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbmime.h000066400000000000000000000062401351404474700252370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbnativeinterface.h000066400000000000000000000105031351404474700274540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbobject.h000066400000000000000000000047701351404474700255640ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbscreen.h000066400000000000000000000115451351404474700255730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbsessionmanager.h000066400000000000000000000063441351404474700273330ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbsystemtraytracker.h000066400000000000000000000062671351404474700301210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbwindow.h000066400000000000000000000167051351404474700256260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbwmsupport.h000066400000000000000000000047601351404474700263750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxcbxsettings.h000066400000000000000000000054431351404474700263440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.3.2/qxlibconvenience.h000066400000000000000000000043641351404474700267730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/000077500000000000000000000000001351404474700232565ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/LICENSE000066400000000000000000001045051351404474700242700ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qglxintegration.h000066400000000000000000000066411351404474700266550ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbbackingstore.h000066400000000000000000000047511351404474700267670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbclipboard.h000066400000000000000000000101471351404474700262470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbconnection.h000066400000000000000000000460731351404474700264560ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbcursor.h000066400000000000000000000067551351404474700256370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbdrag.h000066400000000000000000000120051351404474700252200ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbeglsurface.h000066400000000000000000000040301351404474700264220ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbimage.h000066400000000000000000000045411351404474700253730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbintegration.h000066400000000000000000000100141351404474700266240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbkeyboard.h000066400000000000000000000105061351404474700261070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbmime.h000066400000000000000000000054571351404474700252470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbnativeinterface.h000066400000000000000000000114301351404474700274530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbobject.h000066400000000000000000000042031351404474700255520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbscreen.h000066400000000000000000000116311351404474700255660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbsessionmanager.h000066400000000000000000000055571351404474700273370ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbsystemtraytracker.h000066400000000000000000000055021351404474700301070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbwindow.h000066400000000000000000000167201351404474700256220ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbwmsupport.h000066400000000000000000000041731351404474700263720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxcbxsettings.h000066400000000000000000000047041351404474700263420ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.0/qxlibconvenience.h000066400000000000000000000035771351404474700267770ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/000077500000000000000000000000001351404474700232575ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/LICENSE000066400000000000000000001045051351404474700242710ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qglxintegration.h000066400000000000000000000066411351404474700266560ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbbackingstore.h000066400000000000000000000047511351404474700267700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbclipboard.h000066400000000000000000000101471351404474700262500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbconnection.h000066400000000000000000000461601351404474700264540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbcursor.h000066400000000000000000000067551351404474700256400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbdrag.h000066400000000000000000000122051351404474700252230ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbeglsurface.h000066400000000000000000000040301351404474700264230ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbimage.h000066400000000000000000000045411351404474700253740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbintegration.h000066400000000000000000000100401351404474700266240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbkeyboard.h000066400000000000000000000105061351404474700261100ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbmime.h000066400000000000000000000054571351404474700252500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbnativeinterface.h000066400000000000000000000114571351404474700274650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbobject.h000066400000000000000000000042031351404474700255530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbscreen.h000066400000000000000000000121541351404474700255700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbsessionmanager.h000066400000000000000000000055571351404474700273400ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbsystemtraytracker.h000066400000000000000000000055021351404474700301100ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbwindow.h000066400000000000000000000170371351404474700256250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbwmsupport.h000066400000000000000000000041731351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxcbxsettings.h000066400000000000000000000047041351404474700263430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.1/qxlibconvenience.h000066400000000000000000000035771351404474700270000ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/000077500000000000000000000000001351404474700232605ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/LICENSE000066400000000000000000001045051351404474700242720ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qglxintegration.h000066400000000000000000000066411351404474700266570ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbbackingstore.h000066400000000000000000000047511351404474700267710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbclipboard.h000066400000000000000000000101471351404474700262510ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbconnection.h000066400000000000000000000464761351404474700264670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbcursor.h000066400000000000000000000067551351404474700256410ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbdrag.h000066400000000000000000000122051351404474700252240ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbeglsurface.h000066400000000000000000000040301351404474700264240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbimage.h000066400000000000000000000045411351404474700253750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbintegration.h000066400000000000000000000100401351404474700266250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbkeyboard.h000066400000000000000000000105061351404474700261110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbmime.h000066400000000000000000000054571351404474700252510ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbnativeinterface.h000066400000000000000000000114571351404474700274660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbobject.h000066400000000000000000000042031351404474700255540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbscreen.h000066400000000000000000000121541351404474700255710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbsessionmanager.h000066400000000000000000000055571351404474700273410ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbsystemtraytracker.h000066400000000000000000000055021351404474700301110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbwindow.h000066400000000000000000000170371351404474700256260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbwmsupport.h000066400000000000000000000041731351404474700263740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxcbxsettings.h000066400000000000000000000047041351404474700263440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.4.2/qxlibconvenience.h000066400000000000000000000035771351404474700270010ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/000077500000000000000000000000001351404474700232575ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/LICENSE000066400000000000000000001045051351404474700242710ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbbackingstore.h000066400000000000000000000053501351404474700267640ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbclipboard.h000066400000000000000000000101511351404474700262430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbconnection.h000066400000000000000000000507611351404474700264560ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbcursor.h000066400000000000000000000070261351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbdrag.h000066400000000000000000000122261351404474700252260ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbexport.h000066400000000000000000000034561351404474700256370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbimage.h000066400000000000000000000045221351404474700253730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbintegration.h000066400000000000000000000110341351404474700266300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbkeyboard.h000066400000000000000000000105751351404474700261160ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbmime.h000066400000000000000000000054401351404474700252400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbnativeinterface.h000066400000000000000000000142261351404474700274620ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbobject.h000066400000000000000000000041641351404474700255610ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbscreen.h000066400000000000000000000162421351404474700255720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbsessionmanager.h000066400000000000000000000055401351404474700273300ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbsystemtraytracker.h000066400000000000000000000055031351404474700301110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbwindow.h000066400000000000000000000222701351404474700256200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbwmsupport.h000066400000000000000000000041541351404474700263720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxcbxsettings.h000066400000000000000000000047051351404474700263440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.0/qxlibconvenience.h000066400000000000000000000035601351404474700267700ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/000077500000000000000000000000001351404474700232605ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/LICENSE000066400000000000000000001045051351404474700242720ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbbackingstore.h000066400000000000000000000053501351404474700267650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbclipboard.h000066400000000000000000000101511351404474700262440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbconnection.h000066400000000000000000000505461351404474700264600ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbcursor.h000066400000000000000000000070261351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbdrag.h000066400000000000000000000122261351404474700252270ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbexport.h000066400000000000000000000034561351404474700256400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbimage.h000066400000000000000000000045221351404474700253740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbintegration.h000066400000000000000000000110341351404474700266310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbkeyboard.h000066400000000000000000000105751351404474700261170ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbmime.h000066400000000000000000000054401351404474700252410ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbnativeinterface.h000066400000000000000000000142261351404474700274630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbobject.h000066400000000000000000000041641351404474700255620ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbscreen.h000066400000000000000000000162471351404474700256000ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbsessionmanager.h000066400000000000000000000055401351404474700273310ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbsystemtraytracker.h000066400000000000000000000055031351404474700301120ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbwindow.h000066400000000000000000000222321351404474700256170ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbwmsupport.h000066400000000000000000000041541351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxcbxsettings.h000066400000000000000000000047051351404474700263450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.5.1/qxlibconvenience.h000066400000000000000000000035601351404474700267710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/000077500000000000000000000000001351404474700232605ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/LICENSE000066400000000000000000001045051351404474700242720ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbbackingstore.h000066400000000000000000000053721351404474700267710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbclipboard.h000066400000000000000000000101511351404474700262440ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbconnection.h000066400000000000000000000523721351404474700264570ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbcursor.h000066400000000000000000000071051351404474700256270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbdrag.h000066400000000000000000000123671351404474700252350ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbexport.h000066400000000000000000000034561351404474700256400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbimage.h000066400000000000000000000045221351404474700253740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbintegration.h000066400000000000000000000110341351404474700266310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbkeyboard.h000066400000000000000000000105751351404474700261170ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbmime.h000066400000000000000000000054401351404474700252410ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbnativeinterface.h000066400000000000000000000142221351404474700274570ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbobject.h000066400000000000000000000041641351404474700255620ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbscreen.h000066400000000000000000000173621351404474700255770ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbsessionmanager.h000066400000000000000000000055401351404474700273310ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbsystemtraytracker.h000066400000000000000000000054551351404474700301200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbwindow.h000066400000000000000000000220671351404474700256250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbwmsupport.h000066400000000000000000000041541351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.0/qxcbxsettings.h000066400000000000000000000047051351404474700263450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/000077500000000000000000000000001351404474700232615ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/LICENSE000066400000000000000000001045051351404474700242730ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbbackingstore.h000066400000000000000000000053721351404474700267720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbclipboard.h000066400000000000000000000101511351404474700262450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbconnection.h000066400000000000000000000532031351404474700264520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbcursor.h000066400000000000000000000071051351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbdrag.h000066400000000000000000000125331351404474700252310ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbexport.h000066400000000000000000000034561351404474700256410ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbimage.h000066400000000000000000000045221351404474700253750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbintegration.h000066400000000000000000000110341351404474700266320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbkeyboard.h000066400000000000000000000106341351404474700261140ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbmime.h000066400000000000000000000054401351404474700252420ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbnativeinterface.h000066400000000000000000000142221351404474700274600ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbobject.h000066400000000000000000000041641351404474700255630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbscreen.h000066400000000000000000000174641351404474700256030ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbsessionmanager.h000066400000000000000000000055401351404474700273320ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbsystemtraytracker.h000066400000000000000000000054551351404474700301210ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbwindow.h000066400000000000000000000233701351404474700256240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbwmsupport.h000066400000000000000000000041541351404474700263740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxcbxsettings.h000066400000000000000000000047051351404474700263460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.1/qxlibconvenience.h000066400000000000000000000035601351404474700267720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/000077500000000000000000000000001351404474700232625ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/LICENSE000066400000000000000000001045051351404474700242740ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbbackingstore.h000066400000000000000000000053721351404474700267730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbclipboard.h000066400000000000000000000101511351404474700262460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbconnection.h000066400000000000000000000532611351404474700264570ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbcursor.h000066400000000000000000000071051351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbdrag.h000066400000000000000000000125331351404474700252320ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbexport.h000066400000000000000000000034561351404474700256420ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbimage.h000066400000000000000000000045221351404474700253760ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbintegration.h000066400000000000000000000110341351404474700266330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbkeyboard.h000066400000000000000000000106341351404474700261150ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbmime.h000066400000000000000000000054401351404474700252430ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbnativeinterface.h000066400000000000000000000142221351404474700274610ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbobject.h000066400000000000000000000041641351404474700255640ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbscreen.h000066400000000000000000000174641351404474700256040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbsessionmanager.h000066400000000000000000000055401351404474700273330ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbsystemtraytracker.h000066400000000000000000000054551351404474700301220ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbwindow.h000066400000000000000000000235721351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbwmsupport.h000066400000000000000000000041541351404474700263750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxcbxsettings.h000066400000000000000000000047051351404474700263470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.6.2/qxlibconvenience.h000066400000000000000000000035601351404474700267730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/000077500000000000000000000000001351404474700232615ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/LICENSE000066400000000000000000001045051351404474700242730ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbbackingstore.h000066400000000000000000000061361351404474700267710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbclipboard.h000066400000000000000000000106751351404474700262600ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbconnection.h000066400000000000000000000546021351404474700264560ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbcursor.h000066400000000000000000000100701351404474700256230ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbdrag.h000066400000000000000000000132571351404474700252350ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbexport.h000066400000000000000000000042021351404474700256270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbimage.h000066400000000000000000000052461351404474700254010ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbintegration.h000066400000000000000000000116301351404474700266340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbkeyboard.h000066400000000000000000000113601351404474700261110ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbmime.h000066400000000000000000000061641351404474700252460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbnativeinterface.h000066400000000000000000000151471351404474700274670ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbobject.h000066400000000000000000000047101351404474700255600ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbscreen.h000066400000000000000000000204431351404474700255720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbsessionmanager.h000066400000000000000000000062641351404474700273360ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbsystemtraytracker.h000066400000000000000000000062011351404474700301070ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbwindow.h000066400000000000000000000242121351404474700256200ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbwmsupport.h000066400000000000000000000047001351404474700263710ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxcbxsettings.h000066400000000000000000000054311351404474700263430ustar00rootroot00000000000000/**************************************************************************** ** ** 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) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.0/qxlibconvenience.h000066400000000000000000000035601351404474700267720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/000077500000000000000000000000001351404474700232625ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/LICENSE000066400000000000000000001045051351404474700242740ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbbackingstore.h000066400000000000000000000061361351404474700267720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbclipboard.h000066400000000000000000000107141351404474700262530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbconnection.h000066400000000000000000000546601351404474700264630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbcursor.h000066400000000000000000000100701351404474700256240ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbdrag.h000066400000000000000000000132571351404474700252360ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbexport.h000066400000000000000000000042021351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbimage.h000066400000000000000000000052461351404474700254020ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbintegration.h000066400000000000000000000116301351404474700266350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbkeyboard.h000066400000000000000000000114761351404474700261220ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbmime.h000066400000000000000000000061641351404474700252470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbnativeinterface.h000066400000000000000000000151471351404474700274700ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbobject.h000066400000000000000000000047101351404474700255610ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbscreen.h000066400000000000000000000204431351404474700255730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbsessionmanager.h000066400000000000000000000062641351404474700273370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbsystemtraytracker.h000066400000000000000000000062011351404474700301100ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbwindow.h000066400000000000000000000245441351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbwmsupport.h000066400000000000000000000047001351404474700263720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.7.1/qxcbxsettings.h000066400000000000000000000054311351404474700263440ustar00rootroot00000000000000/**************************************************************************** ** ** 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) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/000077500000000000000000000000001351404474700232625ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/LICENSE000066400000000000000000001045051351404474700242740ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbbackingstore.h000066400000000000000000000061361351404474700267720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbclipboard.h000066400000000000000000000107141351404474700262530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbconnection.h000066400000000000000000000554101351404474700264550ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbcursor.h000066400000000000000000000100701351404474700256240ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbdrag.h000066400000000000000000000134231351404474700252310ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbexport.h000066400000000000000000000042021351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbimage.h000066400000000000000000000052461351404474700254020ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbintegration.h000066400000000000000000000116301351404474700266350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbkeyboard.h000066400000000000000000000115011351404474700261070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbmime.h000066400000000000000000000061641351404474700252470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbnativeinterface.h000066400000000000000000000150651351404474700274670ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbobject.h000066400000000000000000000047101351404474700255610ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbscreen.h000066400000000000000000000203161351404474700255720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbsessionmanager.h000066400000000000000000000063611351404474700273350ustar00rootroot00000000000000/**************************************************************************** ** ** 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() 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbsystemtraytracker.h000066400000000000000000000062011351404474700301100ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbwindow.h000066400000000000000000000246371351404474700256340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbwmsupport.h000066400000000000000000000047001351404474700263720ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.8.0/qxcbxsettings.h000066400000000000000000000054311351404474700263440ustar00rootroot00000000000000/**************************************************************************** ** ** 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) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/000077500000000000000000000000001351404474700232635ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/LICENSE000066400000000000000000001045051351404474700242750ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbbackingstore.h000066400000000000000000000060371351404474700267730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbclipboard.h000066400000000000000000000107321351404474700262540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbconnection.h000066400000000000000000000570561351404474700264660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbcursor.h000066400000000000000000000100361351404474700256270ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbdrag.h000066400000000000000000000133141351404474700252310ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbexport.h000066400000000000000000000042021351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbimage.h000066400000000000000000000052461351404474700254030ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbintegration.h000066400000000000000000000115321351404474700266370ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbkeyboard.h000066400000000000000000000115751351404474700261230ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbmime.h000066400000000000000000000061641351404474700252500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbnativeinterface.h000066400000000000000000000147611351404474700274720ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbobject.h000066400000000000000000000047101351404474700255620ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbscreen.h000066400000000000000000000204661351404474700256010ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbsessionmanager.h000066400000000000000000000062711351404474700273360ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301240ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbwindow.h000066400000000000000000000245241351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbwmsupport.h000066400000000000000000000047001351404474700263730ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.0/qxcbxsettings.h000066400000000000000000000054221351404474700263450ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/000077500000000000000000000000001351404474700232645ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/LICENSE000066400000000000000000001045051351404474700242760ustar00rootroot00000000000000 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 . qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbbackingstore.h000066400000000000000000000060371351404474700267740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbclipboard.h000066400000000000000000000107321351404474700262550ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbconnection.h000066400000000000000000000570561351404474700264670ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbcursor.h000066400000000000000000000100361351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbdrag.h000066400000000000000000000133141351404474700252320ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbexport.h000066400000000000000000000042021351404474700256320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbimage.h000066400000000000000000000052461351404474700254040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbintegration.h000066400000000000000000000115321351404474700266400ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbkeyboard.h000066400000000000000000000115751351404474700261240ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbmime.h000066400000000000000000000061641351404474700252510ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbnativeinterface.h000066400000000000000000000147611351404474700274730ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbobject.h000066400000000000000000000047101351404474700255630ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbscreen.h000066400000000000000000000204661351404474700256020ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbsessionmanager.h000066400000000000000000000062711351404474700273370ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301250ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbwindow.h000066400000000000000000000252601351404474700256270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbwmsupport.h000066400000000000000000000047001351404474700263740ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.1/qxcbxsettings.h000066400000000000000000000054221351404474700263460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/000077500000000000000000000000001351404474700232655ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbbackingstore.h000066400000000000000000000060371351404474700267750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbclipboard.h000066400000000000000000000107321351404474700262560ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbconnection.h000066400000000000000000000571601351404474700264640ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbcursor.h000066400000000000000000000100341351404474700256270ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbdrag.h000066400000000000000000000133141351404474700252330ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbexport.h000066400000000000000000000042021351404474700256330ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbimage.h000066400000000000000000000052461351404474700254050ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbintegration.h000066400000000000000000000115371351404474700266460ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbkeyboard.h000066400000000000000000000115751351404474700261250ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbmime.h000066400000000000000000000061641351404474700252520ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbnativeinterface.h000066400000000000000000000147611351404474700274740ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbobject.h000066400000000000000000000047101351404474700255640ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbscreen.h000066400000000000000000000204661351404474700256030ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbsessionmanager.h000066400000000000000000000062711351404474700273400ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301260ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbwindow.h000066400000000000000000000252601351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbwmsupport.h000066400000000000000000000047001351404474700263750ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.2/qxcbxsettings.h000066400000000000000000000054221351404474700263470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/000077500000000000000000000000001351404474700232665ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbbackingstore.h000066400000000000000000000060371351404474700267760ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbclipboard.h000066400000000000000000000107321351404474700262570ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbconnection.h000066400000000000000000000571601351404474700264650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbcursor.h000066400000000000000000000100341351404474700256300ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbdrag.h000066400000000000000000000133141351404474700252340ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbexport.h000066400000000000000000000042021351404474700256340ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbimage.h000066400000000000000000000052461351404474700254060ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbintegration.h000066400000000000000000000115371351404474700266470ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbkeyboard.h000066400000000000000000000115751351404474700261260ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbmime.h000066400000000000000000000061641351404474700252530ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbnativeinterface.h000066400000000000000000000147611351404474700274750ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbobject.h000066400000000000000000000047101351404474700255650ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbscreen.h000066400000000000000000000204661351404474700256040ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbsessionmanager.h000066400000000000000000000062711351404474700273410ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301270ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbwindow.h000066400000000000000000000252601351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbwmsupport.h000066400000000000000000000047001351404474700263760ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.3/qxcbxsettings.h000066400000000000000000000054221351404474700263500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/000077500000000000000000000000001351404474700232675ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbbackingstore.h000066400000000000000000000060371351404474700267770ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbclipboard.h000066400000000000000000000107321351404474700262600ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbconnection.h000066400000000000000000000571601351404474700264660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 "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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbcursor.h000066400000000000000000000100341351404474700256310ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbdrag.h000066400000000000000000000134661351404474700252450ustar00rootroot00000000000000/**************************************************************************** ** ** 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_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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbexport.h000066400000000000000000000042021351404474700256350ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbimage.h000066400000000000000000000052461351404474700254070ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbintegration.h000066400000000000000000000115371351404474700266500ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbkeyboard.h000066400000000000000000000115751351404474700261270ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbmime.h000066400000000000000000000061641351404474700252540ustar00rootroot00000000000000/**************************************************************************** ** ** 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 #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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbnativeinterface.h000066400000000000000000000147611351404474700274760ustar00rootroot00000000000000/**************************************************************************** ** ** 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" 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbobject.h000066400000000000000000000047101351404474700255660ustar00rootroot00000000000000/**************************************************************************** ** ** 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 = 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbscreen.h000066400000000000000000000204661351404474700256050ustar00rootroot00000000000000/**************************************************************************** ** ** 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 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbsessionmanager.h000066400000000000000000000062711351404474700273420ustar00rootroot00000000000000/**************************************************************************** ** ** 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; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbsystemtraytracker.h000066400000000000000000000061761351404474700301300ustar00rootroot00000000000000/**************************************************************************** ** ** 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; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbwindow.h000066400000000000000000000252601351404474700256320ustar00rootroot00000000000000/**************************************************************************** ** ** 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 }; 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbwmsupport.h000066400000000000000000000047001351404474700263770ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/libqt5xcbqpa-dev/5.9.4/qxcbxsettings.h000066400000000000000000000054221351404474700263510ustar00rootroot00000000000000/**************************************************************************** ** ** 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 qt5dxcb-plugin-5.0.1/platformplugin/linux.pri000066400000000000000000000053001351404474700213100ustar00rootroot00000000000000TARGET = dxcb CONFIG += link_pkgconfig PKGCONFIG += 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 mtdev egl cairo greaterThan(QT_MINOR_VERSION, 5): PKGCONFIG += xcb-xinerama #LIBS += -ldl greaterThan(QT_MINOR_VERSION, 4): LIBS += -lQt5XcbQpa HEADERS += \ $$PWD/windoweventhook.h \ $$PWD/xcbnativeeventfilter.h \ $$PWD/dxcbwmsupport.h \ $$PWD/dxcbxsettings.h SOURCES += \ $$PWD/windoweventhook.cpp \ $$PWD/xcbnativeeventfilter.cpp \ $$PWD/utility_x11.cpp \ $$PWD/dxcbwmsupport.cpp \ $$PWD/dforeignplatformwindow_x11.cpp \ $$PWD/dxcbxsettings.cpp contains(QT_CONFIG, xcb-xlib)|qtConfig(xcb-xlib) { DEFINES += XCB_USE_XLIB QMAKE_USE += xcb_xlib greaterThan(QT_MINOR_VERSION, 11) { contains(QT_CONFIG, xcb-xinput)|qtConfig(xcb-xinput) { DEFINES += XCB_USE_XINPUT2 XCB_USE_XINPUT21 XCB_USE_XINPUT22 QMAKE_USE += xcb_xinput !isEmpty(QMAKE_LIBXI_VERSION_MAJOR) { DEFINES += LIBXI_MAJOR=$$QMAKE_LIBXI_VERSION_MAJOR \ LIBXI_MINOR=$$QMAKE_LIBXI_VERSION_MINOR \ LIBXI_PATCH=$$QMAKE_LIBXI_VERSION_PATCH } } } else { contains(QT_CONFIG, xinput2)|qtConfig(xinput2) { DEFINES += XCB_USE_XINPUT2 QMAKE_USE += xinput2 !isEmpty(QMAKE_LIBXI_VERSION_MAJOR) { DEFINES += LIBXI_MAJOR=$$QMAKE_LIBXI_VERSION_MAJOR \ LIBXI_MINOR=$$QMAKE_LIBXI_VERSION_MINOR \ LIBXI_PATCH=$$QMAKE_LIBXI_VERSION_PATCH } } } } # build with session management support contains(QT_CONFIG, xcb-sm)|qtConfig(xcb-sm) { DEFINES += XCB_USE_SM QMAKE_USE += x11sm } !contains(QT_CONFIG, system-xcb)|qtConfig(system-xcb) { DEFINES += XCB_USE_RENDER QMAKE_USE += xcb } else { LIBS += -lxcb-xinerama ### there is no configure test for this! contains(QT_CONFIG, xkb)|qtConfig(xkb): QMAKE_USE += xcb_xkb # to support custom cursors with depth > 1 contains(QT_CONFIG, xcb-render)|qtConfig(xkb) { DEFINES += XCB_USE_RENDER QMAKE_USE += xcb_render } QMAKE_USE += xcb_syslibs } contains(QT_CONFIG, xcb-qt) { DEFINES += XCB_USE_RENDER } exists($$PWD/libqt5xcbqpa-dev/$$QT_VERSION) { INCLUDEPATH += $$PWD/libqt5xcbqpa-dev/$$QT_VERSION } else:exists($$[QT_INSTALL_HEADERS]/QtXcb/$$[QT_VERSION]) { INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QtXcb/$$[QT_VERSION]/QtXcb/private } else { error(Not support Qt Version: $$QT_VERSION) } qt5dxcb-plugin-5.0.1/platformplugin/main.cpp000066400000000000000000000026751351404474700211010ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 if (!system.compare(QLatin1String("dxcb"), Qt::CaseInsensitive)) return new DPlatformIntegration(parameters, argc, argv); #endif return 0; } QT_END_NAMESPACE #include "main.moc" qt5dxcb-plugin-5.0.1/platformplugin/qt5platform-plugin.pro000066400000000000000000000050441351404474700237360ustar00rootroot00000000000000 # NOTE(sbw): 禁止语法树上的 vrp 优化,-O2/-O3 默认开启,会导致测试虚析构函数 HOOK 失败 QMAKE_CXXFLAGS_RELEASE += -fno-tree-vrp PLUGIN_TYPE = platforms PLUGIN_CLASS_NAME = DXcbIntegrationPlugin !equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = - DESTDIR = $$_PRO_FILE_PWD_/../bin/plugins/platforms QT += opengl x11extras QT += core-private #xcb_qpa_lib-private greaterThan(QT_MAJOR_VERSION, 4) { QT += widgets widgets-private # Qt >= 5.8 greaterThan(QT_MINOR_VERSION, 7): QT += gui-private else: QT += platformsupport-private # Qt >= 5.10 greaterThan(QT_MINOR_VERSION, 9): QT += edid_support-private # Qt >= 5.13 greaterThan(QT_MINOR_VERSION, 12): QT += xkbcommon_support-private } TEMPLATE = lib isEmpty(VERSION) { isEmpty(VERSION): VERSION = $$system(git describe --tags --abbrev=0) VERSION = $$replace(VERSION, [^0-9.],) isEmpty(VERSION): VERSION = 1.1.11 } DEFINES += DXCB_VERSION=\\\"$$VERSION\\\" linux: include($$PWD/linux.pri) windows: include($$PWD/windows.pri) CONFIG += plugin c++11 SOURCES += \ $$PWD/main.cpp \ $$PWD/dplatformintegration.cpp \ $$PWD/vtablehook.cpp \ $$PWD/dplatformnativeinterfacehook.cpp \ dhighdpi.cpp \ dnativesettings.cpp \ dnotitlebarwindowhelper.cpp HEADERS += \ $$PWD/dplatformintegration.h \ $$PWD/vtablehook.h \ $$PWD/utility.h \ $$PWD/global.h \ $$PWD/dplatformnativeinterfacehook.h \ $$PWD/dforeignplatformwindow.h \ $$PWD/dwmsupport.h \ dhighdpi.h \ dnativesettings.h \ dnotitlebarwindowhelper.h DISTFILES += \ $$PWD/dpp.json isEmpty(INSTALL_PATH) { target.path = $$[QT_INSTALL_PLUGINS]/platforms } else { target.path = $$INSTALL_PATH } message($$target.path) INSTALLS += target CONFIG(release, debug|release) { DEFINES += QT_NO_DEBUG_OUTPUT USE_NEW_IMPLEMENTING } else { DEFINES += USE_NEW_IMPLEMENTING } contains(DEFINES, USE_NEW_IMPLEMENTING) { SOURCES += \ $$PWD/dframewindow.cpp \ $$PWD/dplatformwindowhelper.cpp \ $$PWD/dplatformbackingstorehelper.cpp \ $$PWD/dplatformopenglcontexthelper.cpp HEADERS += \ $$PWD/dframewindow.h \ $$PWD/dplatformwindowhelper.h \ $$PWD/dplatformbackingstorehelper.h \ $$PWD/dplatformopenglcontexthelper.h } else { SOURCES += \ $$PWD/dplatformbackingstore.cpp \ $$PWD/dplatformwindowhook.cpp HEADERS += \ $$PWD/dplatformbackingstore.h \ $$PWD/dplatformwindowhook.h } RESOURCES += \ cursors/cursor.qrc qt5dxcb-plugin-5.0.1/platformplugin/utility.h000066400000000000000000000156771351404474700213330ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #ifndef UTILITY_H #define UTILITY_H #include #include "global.h" QT_BEGIN_NAMESPACE class QXcbWindow; QT_END_NAMESPACE typedef uint32_t xcb_atom_t; 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 void startWindowSystemMove(quint32 WId); static void cancelWindowMoveResize(quint32 WId); // 在触摸屏下移动窗口时,调用 startWindowSystemMove后,窗管无法grab触摸屏的touch update事件 // 导致窗口无法移动。此处跟deepin-wm配合,使用其它方式通知窗管鼠标位置更新了 static void updateMousePointForWindowMove(quint32 WId); 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); 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 qint32 getWorkspaceForWindow(quint32 WId); static QVector getWindows(); 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; foreach (const QRect &rect, pointRegion.rects()) { pixelRegon += rect * scale; } return pixelRegon; } QT_END_NAMESPACE #endif // UTILITY_H qt5dxcb-plugin-5.0.1/platformplugin/utility_x11.cpp000066400000000000000000000753441351404474700223540ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #include "utility.h" #include "qxcbintegration.h" #include "qxcbconnection.h" #include "qxcbscreen.h" #include "dplatformintegration.h" #include "dxcbwmsupport.h" #include #include #include #include #include #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(const char *name, bool only_if_exists) { if (!name || *name == 0) return XCB_NONE; xcb_intern_atom_cookie_t cookie = xcb_intern_atom(QX11Info::connection(), only_if_exists, strlen(name), name); xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(QX11Info::connection(), cookie, 0); if (!reply) return XCB_NONE; xcb_atom_t atom = reply->atom; free(reply); return atom; } 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) { 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(); xev.data.data32[2] = 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 datas[4]; datas[0] = int32_t(margins.left()); datas[1] = int32_t(margins.right()); datas[2] = int32_t(margins.top()); datas[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, datas); } static QVector qregion2XcbRectangles(const QRegion ®ion) { QVector rectangles; rectangles.reserve(region.rectCount()); for (const QRect &rect : region.rects()) { 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()) { foreach(const QRect &area, QRegion(polygon.toPolygon()).rects()) { 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 (const QRect &rect : region.rects()) { 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); } } 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()) { foreach(const QRect &area, QRegion(polygon.toPolygon()).rects()) { 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()) { foreach(const QRect &area, QRegion(polygon.toPolygon()).rects()) { 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.byteCount()); array.append((const char*)area.constData(), sizeof(qint32) / sizeof(char) * area.size()); array.append((const char*)maskImage.constBits(), maskImage.byteCount()); 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; } 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); } 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::_MOTIF_WM_HINTS), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::_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::_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.functions = 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::_MOTIF_WM_HINTS), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::_MOTIF_WM_HINTS), 32, 5, &hints), c); #else xcb_change_property(DPlatformIntegration::xcbConnection()->xcb_connection(), XCB_PROP_MODE_REPLACE, WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::_MOTIF_WM_HINTS), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::_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::_MOTIF_WM_HINTS)), DPlatformIntegration::xcbConnection()->xcb_connection()); #else xcb_delete_property(DPlatformIntegration::xcbConnection()->xcb_connection(), WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::_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); xcb_query_tree_reply_t *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; free(reply); } 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::_NET_WM_NAME), connection->atom(QXcbAtom::UTF8_STRING), 8, ba.length(), ba.constData()); //#endif xcb_change_property(connection->xcb_connection(), XCB_PROP_MODE_REPLACE, group_leader, connection->atom(QXcbAtom::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::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(); } 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 qt5dxcb-plugin-5.0.1/platformplugin/vtablehook.cpp000066400000000000000000000151621351404474700223060ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #include "vtablehook.h" #include DPP_BEGIN_NAMESPACE QMap VtableHook::objToOriginalVfptr; QMap VtableHook::objToGhostVfptr; QMap VtableHook::objDestructFun; bool VtableHook::copyVtable(quintptr **obj) { int vtable_size = getVtableSize(obj); if (vtable_size == 0) return false; // 多开辟一个元素, 新的虚表结构如下: // 假设obj对象原虚表长度为2, 表结构为: // ┏━━┳━━┳━━┓其中v1 v2为虚函数地址, 0为数组结尾 // ┃v1┃v2┃\0┃ // ┗━━┻━━┻━━┛ // 则新的表结构为: // ┏━━┳━━┳━━┳━━┓其中前三个元素为原虚表的复制, sv为原虚表入口地址 // ┃v1┃v2┃\0┃sv┃ // ┗━━┻━━┻━━┻━━┛ vtable_size += 2; quintptr *new_vtable = new quintptr[vtable_size]; memcpy(new_vtable, *obj, (vtable_size - 1) * sizeof(quintptr)); //! save original vfptr objToOriginalVfptr[obj] = *obj; // 存储对象原虚表入口地址 new_vtable[vtable_size - 1] = quintptr(*obj); *obj = new_vtable; //! save ghost vfptr objToGhostVfptr[obj] = new_vtable; return true; } bool VtableHook::clearGhostVtable(void *obj) { objToOriginalVfptr.remove((quintptr**)obj); objDestructFun.remove(obj); quintptr *vtable = objToGhostVfptr.take(obj); if (vtable) { delete[] vtable; return true; } return false; } /*! * \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(new_vtable, new_vtable + vtable_size, quintptr(&_DestoryProbe::nothing)); // 给对象设置新的虚表 *obj = new_vtable; int index = -1; for (int i = 0; i < vtable_size; ++i) { new_vtable[i] = quintptr(&_DestoryProbe::probe); // 尝试销毁此对象, 且观察_DestoryProbe::probe是否被调用 // 如果被调用, 则证明覆盖此虚函数能达到监控对象被销毁的目的 destoryObjFun(); if (_DestoryProbe::probe(0) == quintptr(obj)) { index = i; break; } } // 恢复旧的虚表 *obj = vtable; // 销毁临时虚表 delete[] new_vtable; return index; } void VtableHook::autoCleanVtable(void *obj) { quintptr fun = objDestructFun.value(obj); if (!fun) return; typedef void(*Destruct)(void*); Destruct destruct = *reinterpret_cast(&fun); // call origin destruct function destruct(obj); // clean clearGhostVtable(obj); } bool VtableHook::ensureVtable(void *obj, std::function destoryObjFun) { quintptr **_obj = (quintptr**)(obj); if (objToOriginalVfptr.contains(_obj)) { // 不知道什么原因, 此时obj对象的虚表已经被还原 if (objToGhostVfptr.value((void*)obj) != *_obj) { clearGhostVtable((void*)obj); } else { return true; } } if (!copyVtable(_obj)) return false; // 查找对象的析构函数 int index = getDestructFunIndex(_obj, destoryObjFun); // 虚析构函数查找失败 if (index < 0) { qWarning("Failed do override destruct function"); qDebug() << "object:" << obj; abort(); } quintptr *new_vtable = *_obj; // 保存对象真实的析构函数 objDestructFun[(void*)obj] = new_vtable[index]; // 覆盖析构函数, 用于在对象析构时自动清理虚表 new_vtable[index] = reinterpret_cast(&autoCleanVtable); return true; } /*! * \brief VtableHook::hasVtable 对象的虚表已经被覆盖时返回true,否则返回false * \param obj * \return */ bool VtableHook::hasVtable(void *obj) { quintptr **_obj = (quintptr**)(obj); return objToGhostVfptr.contains(_obj); } /*! * \brief 将偏移量为functionOffset的虚函数还原到原本的实现 * \param obj * \param functionIndex * \return 如果成功, 返回还原之前obj对象虚表中存储的函数指针, 否则返回0 */ quintptr VtableHook::resetVfptrFun(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(void *obj, quintptr functionOffset) { quintptr **_obj = (quintptr**)obj; int vtable_size = getVtableSize(_obj); // 获取obj对象原本虚表的入口 quintptr *vfptr_t2 = (quintptr*)(*_obj)[vtable_size + 1]; if (!vfptr_t2) { qWarning() << "Not override the object virtual table" << obj; return 0; } if (functionOffset > UINT_LEAST16_MAX) { qWarning() << "Is not a virtual function, function address: 0x" << hex << functionOffset; return 0; } return *(vfptr_t2 + functionOffset / sizeof(quintptr)); } DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/vtablehook.h000066400000000000000000000165151351404474700217560ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #ifndef VTABLEHOOK_H #define VTABLEHOOK_H #include #include #include #include "global.h" #include DPP_BEGIN_NAMESPACE static inline quintptr toQuintptr(void *ptr) { return *(quintptr*)ptr; } static inline int getVtableSize(quintptr **obj) { quintptr *begin = *obj; while(*begin) ++begin; return begin - *obj; } class VtableHook { public: 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(void *obj); static bool ensureVtable(void *obj, std::function destoryObjFun); static bool hasVtable(void *obj); static quintptr resetVfptrFun(void *obj, quintptr functionOffset); static quintptr originalFun(void *obj, quintptr functionOffset); template class OverrideDestruct : public T { ~OverrideDestruct() override;}; template struct CheckCompatibleArguments { enum { value = false }; }; template struct CheckCompatibleArguments { enum { value = 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; typedef QtPrivate::FunctionPointer FunInfo2; // 检查析构函数是否为虚 class OverrideDestruct : public FunInfo1::Object { ~OverrideDestruct() override;}; //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; if (!ensureVtable((void*)t1, std::bind(&_destory_helper, t1))) { return false; } quintptr *vfptr_t1 = *(quintptr**)t1; quintptr *vfptr_t2 = *(quintptr**)t2; if (fun2_offset > UINT_LEAST16_MAX) *(vfptr_t1 + fun1_offset / sizeof(quintptr)) = fun2_offset; else *(vfptr_t1 + fun1_offset / sizeof(quintptr)) = *(vfptr_t2 + fun2_offset / sizeof(quintptr)); return true; } template struct FunctionPointer { }; template struct FunctionPointer { typedef QtPrivate::List Arguments; }; template struct FunctionPointer { typedef QtPrivate::List Arguments; }; template static bool overrideVfptrFun(const typename QtPrivate::FunctionPointer::Object *t1, Fun1 fun1, Fun2 fun2) { typedef QtPrivate::FunctionPointer FunInfo1; typedef QtPrivate::FunctionPointer FunInfo2; // 检查析构函数是否为虚 class OverrideDestruct : public FunInfo1::Object { ~OverrideDestruct() override;}; 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; if (!ensureVtable((void*)t1, std::bind(&_destory_helper, t1))) { return false; } quintptr *vfptr_t1 = *(quintptr**)t1; *(vfptr_t1 + fun1_offset / sizeof(quintptr)) = fun2_offset; return true; } 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 = VtableHook::resetVfptrFun((void*)obj, fun_offset); if (!rvf.oldFun) { qWarning() << "Reset the function failed, object:" << obj; abort(); } // call return (obj->*fun)(std::forward(args)...); } private: static bool copyVtable(quintptr **obj); static bool clearGhostVtable(void *obj); template static void _destory_helper(const T *obj) { delete obj; } static QMap objToOriginalVfptr; static QMap objToGhostVfptr; static QMap objDestructFun; }; DPP_END_NAMESPACE #endif // VTABLEHOOK_H qt5dxcb-plugin-5.0.1/platformplugin/windoweventhook.cpp000066400000000000000000000513221351404474700234000ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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); WindowEventHook::WindowEventHook(QXcbWindow *window, bool redirectContent) { const Qt::WindowType &type = window->window()->type(); if (redirectContent) { VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handleMapNotifyEvent, this, &WindowEventHook::handleMapNotifyEvent); } VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handleConfigureNotifyEvent, this, &WindowEventHook::handleConfigureNotifyEvent); if (type == Qt::Widget || type == Qt::Window || type == Qt::Dialog) { VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handleClientMessageEvent, this, &WindowEventHook::handleClientMessageEvent); VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handleFocusInEvent, this, &WindowEventHook::handleFocusInEvent); VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handleFocusOutEvent, this, &WindowEventHook::handleFocusOutEvent); #ifdef XCB_USE_XINPUT22 VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handleXIEnterLeave, this, &WindowEventHook::handleXIEnterLeave); #endif VtableHook::overrideVfptrFun(window, &QPlatformWindow::windowEvent, this, &WindowEventHook::windowEvent); } if (type == Qt::Window) { VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handlePropertyNotifyEvent, this, &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::XdndActionCopy); case Qt::LinkAction: return drag->atom(QXcbAtom::XdndActionLink); case Qt::MoveAction: case Qt::TargetMoveAction: return drag->atom(QXcbAtom::XdndActionMove); case Qt::IgnoreAction: return XCB_NONE; default: return drag->atom(QXcbAtom::XdndActionCopy); } } void WindowEventHook::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) { QXcbWindow *me = window(); DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(me); if (helper) { QWindowPrivate::get(me->window())->parentWindow = helper->m_frameWindow; } me->QXcbWindow::handleConfigureNotifyEvent(event); if (helper) { QWindowPrivate::get(me->window())->parentWindow = nullptr; if (helper->m_frameWindow->redirectContent()) helper->m_frameWindow->markXPixmapToDirty(event->width, event->height); } } void WindowEventHook::handleMapNotifyEvent(const xcb_map_notify_event_t *event) { QXcbWindow *me = window(); me->QXcbWindow::handleMapNotifyEvent(event); if (DFrameWindow *frame = qobject_cast(me->window())) { frame->markXPixmapToDirty(); } else if (DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(me)) { helper->m_frameWindow->markXPixmapToDirty(); } } static Qt::DropAction toDropAction(QXcbConnection *c, xcb_atom_t a) { if (a == c->atom(QXcbAtom::XdndActionCopy) || a == 0) return Qt::CopyAction; if (a == c->atom(QXcbAtom::XdndActionLink)) return Qt::LinkAction; if (a == c->atom(QXcbAtom::XdndActionMove)) return Qt::MoveAction; return Qt::CopyAction; } void WindowEventHook::handleClientMessageEvent(const xcb_client_message_event_t *event) { QXcbWindow *me = window(); if (event->format != 32) { return me->QXcbWindow::handleClientMessageEvent(event); } do { if (event->type != me->atom(QXcbAtom::XdndPosition) && event->type != me->atom(QXcbAtom::XdndDrop)) { break; } QXcbDrag *drag = me->connection()->drag(); // 不处理自己的drag事件 if (drag->currentDrag()) { break; } int offset = 0; int remaining = 0; xcb_connection_t *xcb_connection = me->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, me->connection()->atom(QXcbAtom::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(me->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 == me->atom(QXcbAtom::XdndDrop)) { QXcbDrag *drag = me->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); QPlatformDropQtResponse response = QWindowSystemInterface::handleDrop(drag->currentWindow.data(), dropData, drag->currentPosition, supported_drop_actions); 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::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 { me->QXcbWindow::handleClientMessageEvent(event); } } bool WindowEventHook::relayFocusToModalWindow(QWindow *w, QXcbConnection *connection) { QWindow *modal_window = 0; if (QGuiApplicationPrivate::instance()->isWindowBlocked(w,&modal_window) && modal_window != w) { if (!modal_window->isExposed()) return false; modal_window->requestActivate(); connection->flush(); return true; } return false; } void WindowEventHook::handleFocusInEvent(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; QXcbWindow *xcbWindow = window(); QWindow *w = static_cast(QObjectPrivate::get(xcbWindow->window()))->eventReceiver(); if (DFrameWindow *frame = qobject_cast(w)) { if (frame->m_contentWindow) w = frame->m_contentWindow; else return; } if (relayFocusToModalWindow(w, xcbWindow->connection())) return; #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) xcbWindow->connection()->focusInTimer().stop(); #endif #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) xcbWindow->connection()->setFocusWindow(w); #else xcbWindow->connection()->setFocusWindow(static_cast(w->handle())); #endif QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); } enum QX11EmbedMessageType { XEMBED_EMBEDDED_NOTIFY = 0, XEMBED_WINDOW_ACTIVATE = 1, XEMBED_WINDOW_DEACTIVATE = 2, XEMBED_REQUEST_FOCUS = 3, XEMBED_FOCUS_IN = 4, XEMBED_FOCUS_OUT = 5, XEMBED_FOCUS_NEXT = 6, XEMBED_FOCUS_PREV = 7, XEMBED_MODALITY_ON = 10, XEMBED_MODALITY_OFF = 11, XEMBED_REGISTER_ACCELERATOR = 12, XEMBED_UNREGISTER_ACCELERATOR = 13, XEMBED_ACTIVATE_ACCELERATOR = 14 }; static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event) { if (!event) { // FocusIn event is not in the queue, proceed with FocusOut normally. QWindowSystemInterface::handleWindowActivated(0, Qt::ActiveWindowFocusReason); return true; } uint response_type = event->response_type & ~0x80; if (response_type == XCB_FOCUS_IN) { // 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. xcb_focus_in_event_t *e = (xcb_focus_in_event_t *) event; if (e->detail != XCB_NOTIFY_DETAIL_POINTER) return true; } /* We are also interested in XEMBED_FOCUS_IN events */ if (response_type == XCB_CLIENT_MESSAGE) { xcb_client_message_event_t *cme = (xcb_client_message_event_t *)event; if (cme->type == connection->atom(QXcbAtom::_XEMBED) && cme->data.data32[1] == XEMBED_FOCUS_IN) return true; } return false; } void WindowEventHook::handleFocusOutEvent(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; QXcbWindow *xcbWindow = window(); QWindow *w = static_cast(QObjectPrivate::get(xcbWindow->window()))->eventReceiver(); if (relayFocusToModalWindow(w, xcbWindow->connection())) return; xcbWindow->connection()->setFocusWindow(0); // Do not set the active window to 0 if there is a FocusIn coming. // There is however no equivalent for XPutBackEvent so register a // callback for QXcbConnection instead. #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) xcbWindow->connection()->focusInTimer().start(400); #else xcbWindow->connection()->addPeekFunc(focusInPeeker); #endif } void WindowEventHook::handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) { DQXcbWindow *window = reinterpret_cast(this->window()); QWindow *ww = window->window(); window->QXcbWindow::handlePropertyNotifyEvent(event); if (event->window == window->xcb_window() && event->atom == window->atom(QXcbAtom::_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 = 0; 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(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(QEvent *event) #else bool WindowEventHook::windowEvent(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) { ev->act = support_actions; } } default: break; } QXcbWindow *window = static_cast(reinterpret_cast(this)); return window->QXcbWindow::windowEvent(event); } #endif DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/windoweventhook.h000066400000000000000000000034641351404474700230510ustar00rootroot00000000000000/* * Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #ifndef WINDOWEVENTHOOK_H #define WINDOWEVENTHOOK_H #include "qxcbwindow.h" #include "global.h" DPP_BEGIN_NAMESPACE class WindowEventHook { public: WindowEventHook(QXcbWindow *window, bool redirectContent); QXcbWindow *window() const { return static_cast(reinterpret_cast(const_cast(this)));} void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *); void handleMapNotifyEvent(const xcb_map_notify_event_t *); void handleClientMessageEvent(const xcb_client_message_event_t *event); void handleFocusInEvent(const xcb_focus_in_event_t *event); void handleFocusOutEvent(const xcb_focus_out_event_t *event); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event); #ifdef XCB_USE_XINPUT22 void handleXIEnterLeave(xcb_ge_event_t *event); #endif #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) void windowEvent(QEvent *event); #else bool windowEvent(QEvent *event); #endif private: static bool relayFocusToModalWindow(QWindow *w, QXcbConnection *connection); }; DPP_END_NAMESPACE #endif // WINDOWEVENTHOOK_H qt5dxcb-plugin-5.0.1/platformplugin/windows.pri000066400000000000000000000000001351404474700216330ustar00rootroot00000000000000qt5dxcb-plugin-5.0.1/platformplugin/xcbnativeeventfilter.cpp000066400000000000000000000333701351404474700244040ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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 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::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; } bool XcbNativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result) { 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 (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::_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 (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::_MOTIF_WM_HINTS)) { emit DXcbWMSupport::instance()->windowMotifWMHintsChanged(pn->window); } else { if (pn->window != DPlatformIntegration::instance()->defaultConnection()->rootWindow()) { return false; } if (pn->atom == DPlatformIntegration::instance()->defaultConnection()->atom(QXcbAtom::_NET_SUPPORTED)) { DXcbWMSupport::instance()->updateNetWMAtoms(); } else if (pn->atom == DPlatformIntegration::instance()->defaultConnection()->atom(QXcbAtom::_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(); } } 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 (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 (device != xiDeviceInfoMap.constEnd()) { lastXIEventDeviceInfo = qMakePair(xiDEvent->time, device.value()); } } if (xiEvent->evtype != XI_DeviceChanged) { if (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 (DXcbXSettings::handleClientMessageEvent(ev)) { return true; } break; } default: static auto updateScaleLogcailDpi = qApp->property("_d_updateScaleLogcailDpi").toULongLong(); #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) if (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 (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); } } XIFreeDeviceInfo(devices); } DPP_END_NAMESPACE qt5dxcb-plugin-5.0.1/platformplugin/xcbnativeeventfilter.h000066400000000000000000000033121351404474700240420ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * 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 * 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 . */ #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; bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; 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 qt5dxcb-plugin-5.0.1/qt5dxcb-plugin.pro000066400000000000000000000001121351404474700177560ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += \ platformplugin/qt5platform-plugin.pro