From 6692b4a8dae178795364b5786696a509e8676b20 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 24 Jan 2017 08:49:27 +0100 Subject: [PATCH] refactor(x11): Cleanup --- .travis.yml | 7 +- README.md | 18 ++-- cmake/build/options.cmake | 12 +-- cmake/build/summary.cmake | 16 +-- include/components/bar.hpp | 1 - include/components/controller.hpp | 1 - include/components/screen.hpp | 1 - include/modules/xkeyboard.hpp | 1 - include/modules/xwindow.hpp | 4 +- include/modules/xworkspaces.hpp | 1 - include/settings.hpp.cmake | 2 +- include/x11/connection.hpp | 35 ++----- include/x11/events.hpp | 59 ----------- include/x11/ewmh.hpp | 25 +++-- include/x11/generic.hpp | 24 ----- include/x11/graphics.hpp | 29 ------ include/x11/icccm.hpp | 5 +- include/x11/tray_manager.hpp | 11 ++- include/x11/types.hpp | 45 +++++++++ include/x11/window.hpp | 10 -- include/x11/wm.hpp | 19 ---- include/x11/xembed.hpp | 2 - src/CMakeLists.txt | 8 +- src/components/bar.cpp | 21 ++-- src/components/controller.cpp | 4 - src/components/renderer.cpp | 1 - src/components/screen.cpp | 1 - src/main.cpp | 14 +-- src/modules/xbacklight.cpp | 11 ++- src/modules/xwindow.cpp | 15 ++- src/modules/xworkspaces.cpp | 14 +-- src/utils/i3.cpp | 10 +- src/x11/connection.cpp | 63 +++++++----- src/x11/ewmh.cpp | 158 ++++++++++++++++++------------ src/x11/graphics.cpp | 119 ---------------------- src/x11/icccm.cpp | 22 +++-- src/x11/tray_manager.cpp | 86 +++++++++------- src/x11/window.cpp | 60 +----------- src/x11/winspec.cpp | 2 - src/x11/wm.cpp | 45 --------- 40 files changed, 344 insertions(+), 638 deletions(-) delete mode 100644 include/x11/events.hpp delete mode 100644 include/x11/generic.hpp delete mode 100644 include/x11/graphics.hpp delete mode 100644 include/x11/wm.hpp delete mode 100644 src/x11/graphics.cpp delete mode 100644 src/x11/wm.cpp diff --git a/.travis.yml b/.travis.yml index 2140c381..410f9e77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,15 +13,14 @@ addons: - llvm-toolchain-precise-3.8 - sourceline: "ppa:george-edison55/george-edison" packages: - - gcc-5 - - g++-5 - clang-3.8 - cmake - cmake-data + - g++-5 + - gcc-5 - i3-wm - libasound2-dev - - libboost-dev - - libfreetype6-dev + - libcairo2-dev - libiw-dev - libmpdclient-dev - libxcb-ewmh-dev diff --git a/README.md b/README.md index 1dd49f76..ed238dcd 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,8 @@ A [pull-request has been submitted](https://github.com/voidlinux/void-packages/p ### Dependencies A compiler with C++14 support ([clang-3.4+](http://llvm.org/releases/download.html), [gcc-5.1+](https://gcc.gnu.org/releases.html)). -- cmake -- libXft +- cairo +- libxcb - python2 - xcb-proto - xcb-util-image @@ -77,11 +77,11 @@ A compiler with C++14 support ([clang-3.4+](http://llvm.org/releases/download.ht - xcb-util-xrm Optional dependencies for extended module support: -- alsa-lib (required by `internal/volume`) -- jsoncpp (required by `internal/i3`) -- libmpdclient (required by `internal/mpd`) -- libcurl (required by `internal/github`) -- wireless_tools (required by `internal/network`) +- alsa-lib *required by `internal/volume`* +- jsoncpp *required by `internal/i3`* +- libmpdclient *required by `internal/mpd`* +- libcurl *required by `internal/github`* +- wireless_tools *required by `internal/network`* Find a more complete list on the [dedicated wiki page](https://github.com/jaagr/polybar/wiki/Compiling). @@ -119,10 +119,6 @@ Details on how to setup and configure the bar and each module have been moved to $ polybar example ~~~ -**NOTE:** If the bar output looks odd, it's probably because you're -missing the fonts defined in the config. Update the config or install the -missing fonts. - ### Running diff --git a/cmake/build/options.cmake b/cmake/build/options.cmake index 24e70ae6..91619381 100644 --- a/cmake/build/options.cmake +++ b/cmake/build/options.cmake @@ -66,12 +66,12 @@ option(ENABLE_I3 "Enable i3 support" ON) option(ENABLE_MPD "Enable mpd support" ON) option(ENABLE_NETWORK "Enable network support" ON) -option(WITH_XRANDR "XRANDR support" ON) -option(WITH_XRENDER "XRENDER support" OFF) -option(WITH_XDAMAGE "XDAMAGE support" OFF) -option(WITH_XSYNC "XSYNC support" OFF) -option(WITH_XCOMPOSITE "XCOMPOSITE support" OFF) -option(WITH_XKB "XKB support" ON) +option(WITH_XRANDR "xcb-randr support" ON) +option(WITH_XRENDER "xcb-render support" OFF) +option(WITH_XDAMAGE "xcb-damage support" OFF) +option(WITH_XSYNC "xcb-sync support" OFF) +option(WITH_XCOMPOSITE "xcb-composite support" OFF) +option(WITH_XKB "xcb-xkb support" ON) option(WITH_XRM "xcb-xrm support" ON) if(NOT DEFINED WITH_XRM) diff --git a/cmake/build/summary.cmake b/cmake/build/summary.cmake index 73ffc83d..94a7fae2 100644 --- a/cmake/build/summary.cmake +++ b/cmake/build/summary.cmake @@ -62,14 +62,14 @@ colored_option(STATUS " i3" ENABLE_I3 "32;1" "37;2") colored_option(STATUS " mpd" ENABLE_MPD "32;1" "37;2") colored_option(STATUS " network" ENABLE_NETWORK "32;1" "37;2") message(STATUS " X extensions:") -colored_option(STATUS " XRandR" WITH_XRANDR "32;1" "37;2") -colored_option(STATUS " XRandR (enable monitors)" ENABLE_XRANDR_MONITORS "32;1" "37;2") -colored_option(STATUS " XRender" WITH_XRENDER "32;1" "37;2") -colored_option(STATUS " XDamage" WITH_XDAMAGE "32;1" "37;2") -colored_option(STATUS " XSync" WITH_XSYNC "32;1" "37;2") -colored_option(STATUS " XComposite" WITH_XCOMPOSITE "32;1" "37;2") -colored_option(STATUS " Xkb" WITH_XKB "32;1" "37;2") -colored_option(STATUS " Xrm" WITH_XRM "32;1" "37;2") +colored_option(STATUS " xcb-randr" WITH_XRANDR "32;1" "37;2") +colored_option(STATUS " xcb-randr (monitor support)" ENABLE_XRANDR_MONITORS "32;1" "37;2") +colored_option(STATUS " xcb-render" WITH_XRENDER "32;1" "37;2") +colored_option(STATUS " xcb-damage" WITH_XDAMAGE "32;1" "37;2") +colored_option(STATUS " xcb-sync" WITH_XSYNC "32;1" "37;2") +colored_option(STATUS " xcb-composite" WITH_XCOMPOSITE "32;1" "37;2") +colored_option(STATUS " xcb-xkb" WITH_XKB "32;1" "37;2") +colored_option(STATUS " xcb-xrm" WITH_XRM "32;1" "37;2") if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug") message(STATUS " Debug options:") diff --git a/include/components/bar.hpp b/include/components/bar.hpp index 3d37923a..7387b690 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -9,7 +9,6 @@ #include "events/signal_fwd.hpp" #include "events/signal_receiver.hpp" #include "settings.hpp" -#include "x11/events.hpp" #include "x11/types.hpp" #include "x11/window.hpp" diff --git a/include/components/controller.hpp b/include/components/controller.hpp index 1a616fd9..3b25b099 100644 --- a/include/components/controller.hpp +++ b/include/components/controller.hpp @@ -9,7 +9,6 @@ #include "events/signal_receiver.hpp" #include "events/types.hpp" #include "utils/file.hpp" -#include "x11/events.hpp" #include "x11/types.hpp" POLYBAR_NS diff --git a/include/components/screen.hpp b/include/components/screen.hpp index 47f76244..04ae97f5 100644 --- a/include/components/screen.hpp +++ b/include/components/screen.hpp @@ -4,7 +4,6 @@ #include "components/types.hpp" #include "events/signal_emitter.hpp" #include "events/signal_fwd.hpp" -#include "x11/events.hpp" #include "x11/extensions/randr.hpp" #include "x11/types.hpp" #include "x11/window.hpp" diff --git a/include/modules/xkeyboard.hpp b/include/modules/xkeyboard.hpp index 9569ebc5..ca7b8368 100644 --- a/include/modules/xkeyboard.hpp +++ b/include/modules/xkeyboard.hpp @@ -6,7 +6,6 @@ #include "modules/meta/event_handler.hpp" #include "modules/meta/input_handler.hpp" #include "modules/meta/static_module.hpp" -#include "x11/events.hpp" #include "x11/extensions/xkb.hpp" #include "x11/window.hpp" diff --git a/include/modules/xwindow.hpp b/include/modules/xwindow.hpp index 401e7d1b..f5030ae7 100644 --- a/include/modules/xwindow.hpp +++ b/include/modules/xwindow.hpp @@ -2,7 +2,6 @@ #include "modules/meta/event_handler.hpp" #include "modules/meta/static_module.hpp" -#include "x11/events.hpp" #include "x11/ewmh.hpp" #include "x11/icccm.hpp" #include "x11/window.hpp" @@ -18,7 +17,7 @@ namespace modules { ~active_window(); bool match(const xcb_window_t win) const; - string title(xcb_ewmh_connection_t* ewmh) const; + string title() const; private: xcb_connection_t* m_connection{nullptr}; @@ -43,7 +42,6 @@ namespace modules { static constexpr const char* TAG_LABEL{"