mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-31 07:52:42 +01:00 
			
		
		
		
	Happy clang
This commit is contained in:
		| @@ -13,7 +13,7 @@ class AIconLabel : public ALabel { | |||||||
|              const std::string &format, uint16_t interval = 0, bool ellipsize = false, |              const std::string &format, uint16_t interval = 0, bool ellipsize = false, | ||||||
|              bool enable_click = false, bool enable_scroll = false); |              bool enable_click = false, bool enable_scroll = false); | ||||||
|   virtual ~AIconLabel() = default; |   virtual ~AIconLabel() = default; | ||||||
|   virtual auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  protected: |  protected: | ||||||
|   Gtk::Image image_; |   Gtk::Image image_; | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ class ALabel : public AModule { | |||||||
|          uint16_t interval = 0, bool ellipsize = false, bool enable_click = false, |          uint16_t interval = 0, bool ellipsize = false, bool enable_click = false, | ||||||
|          bool enable_scroll = false); |          bool enable_scroll = false); | ||||||
|   virtual ~ALabel() = default; |   virtual ~ALabel() = default; | ||||||
|   virtual auto update() -> void; |   auto update() -> void override; | ||||||
|   virtual std::string getIcon(uint16_t, const std::string &alt = "", uint16_t max = 0); |   virtual std::string getIcon(uint16_t, const std::string &alt = "", uint16_t max = 0); | ||||||
|   virtual std::string getIcon(uint16_t, const std::vector<std::string> &alts, uint16_t max = 0); |   virtual std::string getIcon(uint16_t, const std::vector<std::string> &alts, uint16_t max = 0); | ||||||
|  |  | ||||||
| @@ -25,7 +25,7 @@ class ALabel : public AModule { | |||||||
|   bool alt_ = false; |   bool alt_ = false; | ||||||
|   std::string default_format_; |   std::string default_format_; | ||||||
|  |  | ||||||
|   virtual bool handleToggle(GdkEventButton *const &e); |   bool handleToggle(GdkEventButton *const &e) override; | ||||||
|   virtual std::string getState(uint8_t value, bool lesser = false); |   virtual std::string getState(uint8_t value, bool lesser = false); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -12,10 +12,10 @@ namespace waybar { | |||||||
| class AModule : public IModule { | class AModule : public IModule { | ||||||
|  public: |  public: | ||||||
|   virtual ~AModule(); |   virtual ~AModule(); | ||||||
|   virtual auto update() -> void; |   auto update() -> void override; | ||||||
|   virtual auto refresh(int) -> void{}; |   virtual auto refresh(int) -> void{}; | ||||||
|   virtual operator Gtk::Widget &(); |   operator Gtk::Widget &() override; | ||||||
|   virtual auto doAction(const std::string& name) -> void; |   auto doAction(const std::string& name) -> void override; | ||||||
|  |  | ||||||
|   Glib::Dispatcher dp; |   Glib::Dispatcher dp; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,8 +14,8 @@ class Group : public AModule { | |||||||
|  public: |  public: | ||||||
|   Group(const std::string&, const Bar&, const Json::Value&); |   Group(const std::string&, const Bar&, const Json::Value&); | ||||||
|   ~Group() = default; |   ~Group() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   operator Gtk::Widget&(); |   operator Gtk::Widget&() override; | ||||||
|   Gtk::Box box; |   Gtk::Box box; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -40,8 +40,8 @@ class Backlight : public ALabel { | |||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   Backlight(const std::string &, const Json::Value &); |   Backlight(const std::string &, const Json::Value &); | ||||||
|   ~Backlight(); |   virtual ~Backlight(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   template <class ForwardIt> |   template <class ForwardIt> | ||||||
| @@ -51,7 +51,7 @@ class Backlight : public ALabel { | |||||||
|   template <class ForwardIt, class Inserter> |   template <class ForwardIt, class Inserter> | ||||||
|   static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev); |   static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev); | ||||||
|  |  | ||||||
|   bool handleScroll(GdkEventScroll *e); |   bool handleScroll(GdkEventScroll *e) override; | ||||||
|  |  | ||||||
|   const std::string preferred_device_; |   const std::string preferred_device_; | ||||||
|   static constexpr int EPOLL_MAX_EVENTS = 16; |   static constexpr int EPOLL_MAX_EVENTS = 16; | ||||||
|   | |||||||
| @@ -29,8 +29,8 @@ namespace fs = std::filesystem; | |||||||
| class Battery : public ALabel { | class Battery : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Battery(const std::string&, const Json::Value&); |   Battery(const std::string&, const Json::Value&); | ||||||
|   ~Battery(); |   virtual ~Battery(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   static inline const fs::path data_dir_ = "/sys/class/power_supply/"; |   static inline const fs::path data_dir_ = "/sys/class/power_supply/"; | ||||||
|   | |||||||
| @@ -45,8 +45,8 @@ class Bluetooth : public ALabel { | |||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   Bluetooth(const std::string&, const Json::Value&); |   Bluetooth(const std::string&, const Json::Value&); | ||||||
|   ~Bluetooth() = default; |   virtual ~Bluetooth() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*, |   static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*, | ||||||
|   | |||||||
| @@ -23,8 +23,8 @@ enum class CldMode { | |||||||
| class Clock final : public ALabel { | class Clock final : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Clock(const std::string&, const Json::Value&); |   Clock(const std::string&, const Json::Value&); | ||||||
|   ~Clock() = default; |   virtual ~Clock() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   auto doAction(const std::string& name) -> void override; |   auto doAction(const std::string& name) -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   | |||||||
| @@ -17,8 +17,8 @@ namespace waybar::modules { | |||||||
| class Cpu : public ALabel { | class Cpu : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Cpu(const std::string&, const Json::Value&); |   Cpu(const std::string&, const Json::Value&); | ||||||
|   ~Cpu() = default; |   virtual ~Cpu() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   double getCpuLoad(); |   double getCpuLoad(); | ||||||
|   | |||||||
| @@ -15,9 +15,9 @@ namespace waybar::modules { | |||||||
| class Custom : public ALabel { | class Custom : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Custom(const std::string&, const std::string&, const Json::Value&); |   Custom(const std::string&, const std::string&, const Json::Value&); | ||||||
|   ~Custom(); |   virtual ~Custom(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   void refresh(int /*signal*/); |   void refresh(int /*signal*/) override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void delayWorker(); |   void delayWorker(); | ||||||
| @@ -25,8 +25,8 @@ class Custom : public ALabel { | |||||||
|   void parseOutputRaw(); |   void parseOutputRaw(); | ||||||
|   void parseOutputJson(); |   void parseOutputJson(); | ||||||
|   void handleEvent(); |   void handleEvent(); | ||||||
|   bool handleScroll(GdkEventScroll* e); |   bool handleScroll(GdkEventScroll* e) override; | ||||||
|   bool handleToggle(GdkEventButton* const& e); |   bool handleToggle(GdkEventButton* const& e) override; | ||||||
|  |  | ||||||
|   const std::string name_; |   const std::string name_; | ||||||
|   std::string text_; |   std::string text_; | ||||||
|   | |||||||
| @@ -14,8 +14,8 @@ namespace waybar::modules { | |||||||
| class Disk : public ALabel { | class Disk : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Disk(const std::string&, const Json::Value&); |   Disk(const std::string&, const Json::Value&); | ||||||
|   ~Disk() = default; |   virtual ~Disk() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   util::SleeperThread thread_; |   util::SleeperThread thread_; | ||||||
|   | |||||||
| @@ -18,8 +18,8 @@ namespace waybar::modules { | |||||||
| class Gamemode : public AModule { | class Gamemode : public AModule { | ||||||
|  public: |  public: | ||||||
|   Gamemode(const std::string &, const Json::Value &); |   Gamemode(const std::string &, const Json::Value &); | ||||||
|   ~Gamemode(); |   virtual ~Gamemode(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   const std::string DEFAULT_ICON_NAME = "input-gaming-symbolic"; |   const std::string DEFAULT_ICON_NAME = "input-gaming-symbolic"; | ||||||
| @@ -39,7 +39,7 @@ class Gamemode : public AModule { | |||||||
|                  const Glib::VariantContainerBase &arguments); |                  const Glib::VariantContainerBase &arguments); | ||||||
|  |  | ||||||
|   void getData(); |   void getData(); | ||||||
|   bool handleToggle(GdkEventButton *const &); |   bool handleToggle(GdkEventButton *const &) override; | ||||||
|  |  | ||||||
|   // Config |   // Config | ||||||
|   std::string format = DEFAULT_FORMAT; |   std::string format = DEFAULT_FORMAT; | ||||||
|   | |||||||
| @@ -10,12 +10,12 @@ namespace waybar::modules::hyprland { | |||||||
| class Language : public waybar::ALabel, public EventHandler { | class Language : public waybar::ALabel, public EventHandler { | ||||||
|  public: |  public: | ||||||
|   Language(const std::string&, const waybar::Bar&, const Json::Value&); |   Language(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~Language(); |   virtual ~Language(); | ||||||
|  |  | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void onEvent(const std::string&); |   void onEvent(const std::string&) override; | ||||||
|  |  | ||||||
|   void initLanguage(); |   void initLanguage(); | ||||||
|   std::string getShortFrom(const std::string&); |   std::string getShortFrom(const std::string&); | ||||||
|   | |||||||
| @@ -10,12 +10,12 @@ namespace waybar::modules::hyprland { | |||||||
| class Submap : public waybar::ALabel, public EventHandler { | class Submap : public waybar::ALabel, public EventHandler { | ||||||
|  public: |  public: | ||||||
|   Submap(const std::string&, const waybar::Bar&, const Json::Value&); |   Submap(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~Submap(); |   virtual ~Submap(); | ||||||
|  |  | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void onEvent(const std::string&); |   void onEvent(const std::string&) override; | ||||||
|  |  | ||||||
|   std::mutex mutex_; |   std::mutex mutex_; | ||||||
|   const Bar& bar_; |   const Bar& bar_; | ||||||
|   | |||||||
| @@ -12,14 +12,14 @@ namespace waybar::modules::hyprland { | |||||||
| class Window : public waybar::ALabel, public EventHandler { | class Window : public waybar::ALabel, public EventHandler { | ||||||
|  public: |  public: | ||||||
|   Window(const std::string&, const waybar::Bar&, const Json::Value&); |   Window(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~Window(); |   virtual ~Window(); | ||||||
|  |  | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   int getActiveWorkspaceID(std::string); |   int getActiveWorkspaceID(std::string); | ||||||
|   std::string getLastWindowTitle(int); |   std::string getLastWindowTitle(int); | ||||||
|   void onEvent(const std::string&); |   void onEvent(const std::string&) override; | ||||||
|  |  | ||||||
|   bool separate_outputs; |   bool separate_outputs; | ||||||
|   std::mutex mutex_; |   std::mutex mutex_; | ||||||
|   | |||||||
| @@ -13,13 +13,13 @@ class IdleInhibitor : public ALabel { | |||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); |   IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~IdleInhibitor(); |   virtual ~IdleInhibitor(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   static std::list<waybar::AModule*> modules; |   static std::list<waybar::AModule*> modules; | ||||||
|   static bool status; |   static bool status; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   bool handleToggle(GdkEventButton* const& e); |   bool handleToggle(GdkEventButton* const& e) override; | ||||||
|   void toggleStatus(); |   void toggleStatus(); | ||||||
|  |  | ||||||
|   const Bar& bar_; |   const Bar& bar_; | ||||||
|   | |||||||
| @@ -17,8 +17,9 @@ namespace waybar::modules { | |||||||
| class Image : public AModule { | class Image : public AModule { | ||||||
|  public: |  public: | ||||||
|   Image(const std::string&, const Json::Value&); |   Image(const std::string&, const Json::Value&); | ||||||
|   auto update() -> void; |   virtual ~Image() = default; | ||||||
|   void refresh(int /*signal*/); |   auto update() -> void override; | ||||||
|  |   void refresh(int /*signal*/) override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void delayWorker(); |   void delayWorker(); | ||||||
|   | |||||||
| @@ -12,12 +12,12 @@ namespace waybar::modules { | |||||||
| class Inhibitor : public ALabel { | class Inhibitor : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Inhibitor(const std::string&, const waybar::Bar&, const Json::Value&); |   Inhibitor(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~Inhibitor() override; |   virtual ~Inhibitor(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   auto activated() -> bool; |   auto activated() -> bool; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   auto handleToggle(::GdkEventButton* const& e) -> bool; |   auto handleToggle(::GdkEventButton* const& e) -> bool override; | ||||||
|  |  | ||||||
|   const std::unique_ptr<::GDBusConnection, void (*)(::GDBusConnection*)> dbus_; |   const std::unique_ptr<::GDBusConnection, void (*)(::GDBusConnection*)> dbus_; | ||||||
|   const std::string inhibitors_; |   const std::string inhibitors_; | ||||||
|   | |||||||
| @@ -14,8 +14,8 @@ namespace waybar::modules { | |||||||
| class JACK : public ALabel { | class JACK : public ALabel { | ||||||
|  public: |  public: | ||||||
|   JACK(const std::string &, const Json::Value &); |   JACK(const std::string &, const Json::Value &); | ||||||
|   ~JACK() = default; |   virtual ~JACK() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|   int bufSize(jack_nframes_t size); |   int bufSize(jack_nframes_t size); | ||||||
|   int sampleRate(jack_nframes_t rate); |   int sampleRate(jack_nframes_t rate); | ||||||
|   | |||||||
| @@ -19,8 +19,8 @@ namespace waybar::modules { | |||||||
| class KeyboardState : public AModule { | class KeyboardState : public AModule { | ||||||
|  public: |  public: | ||||||
|   KeyboardState(const std::string&, const waybar::Bar&, const Json::Value&); |   KeyboardState(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~KeyboardState(); |   virtual ~KeyboardState(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   auto tryAddDevice(const std::string&) -> void; |   auto tryAddDevice(const std::string&) -> void; | ||||||
|   | |||||||
| @@ -13,8 +13,8 @@ namespace waybar::modules { | |||||||
| class Memory : public ALabel { | class Memory : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Memory(const std::string&, const Json::Value&); |   Memory(const std::string&, const Json::Value&); | ||||||
|   ~Memory() = default; |   virtual ~Memory() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void parseMeminfo(); |   void parseMeminfo(); | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ class MPD : public ALabel { | |||||||
|  public: |  public: | ||||||
|   MPD(const std::string&, const Json::Value&); |   MPD(const std::string&, const Json::Value&); | ||||||
|   virtual ~MPD() noexcept = default; |   virtual ~MPD() noexcept = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   std::string getTag(mpd_tag_type type, unsigned idx = 0) const; |   std::string getTag(mpd_tag_type type, unsigned idx = 0) const; | ||||||
|   | |||||||
| @@ -19,9 +19,9 @@ namespace waybar::modules::mpris { | |||||||
| class Mpris : public AModule { | class Mpris : public AModule { | ||||||
|  public: |  public: | ||||||
|   Mpris(const std::string&, const Json::Value&); |   Mpris(const std::string&, const Json::Value&); | ||||||
|   ~Mpris(); |   virtual ~Mpris(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   bool handleToggle(GdkEventButton* const&); |   bool handleToggle(GdkEventButton* const&) override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   static auto onPlayerNameAppeared(PlayerctlPlayerManager*, PlayerctlPlayerName*, gpointer) -> void; |   static auto onPlayerNameAppeared(PlayerctlPlayerManager*, PlayerctlPlayerName*, gpointer) -> void; | ||||||
|   | |||||||
| @@ -21,8 +21,8 @@ namespace waybar::modules { | |||||||
| class Network : public ALabel { | class Network : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Network(const std::string&, const Json::Value&); |   Network(const std::string&, const Json::Value&); | ||||||
|   ~Network(); |   virtual ~Network(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   static const uint8_t MAX_RETRY = 5; |   static const uint8_t MAX_RETRY = 5; | ||||||
|   | |||||||
| @@ -14,8 +14,8 @@ namespace waybar::modules { | |||||||
| class Pulseaudio : public ALabel { | class Pulseaudio : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Pulseaudio(const std::string&, const Json::Value&); |   Pulseaudio(const std::string&, const Json::Value&); | ||||||
|   ~Pulseaudio(); |   virtual ~Pulseaudio(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   static void subscribeCb(pa_context*, pa_subscription_event_type_t, uint32_t, void*); |   static void subscribeCb(pa_context*, pa_subscription_event_type_t, uint32_t, void*); | ||||||
| @@ -25,7 +25,7 @@ class Pulseaudio : public ALabel { | |||||||
|   static void serverInfoCb(pa_context*, const pa_server_info*, void*); |   static void serverInfoCb(pa_context*, const pa_server_info*, void*); | ||||||
|   static void volumeModifyCb(pa_context*, int, void*); |   static void volumeModifyCb(pa_context*, int, void*); | ||||||
|  |  | ||||||
|   bool handleScroll(GdkEventScroll* e); |   bool handleScroll(GdkEventScroll* e) override; | ||||||
|   const std::vector<std::string> getPulseIcon() const; |   const std::vector<std::string> getPulseIcon() const; | ||||||
|  |  | ||||||
|   pa_threaded_mainloop* mainloop_; |   pa_threaded_mainloop* mainloop_; | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ namespace waybar::modules::river { | |||||||
| class Layout : public waybar::ALabel { | class Layout : public waybar::ALabel { | ||||||
|  public: |  public: | ||||||
|   Layout(const std::string &, const waybar::Bar &, const Json::Value &); |   Layout(const std::string &, const waybar::Bar &, const Json::Value &); | ||||||
|   ~Layout(); |   virtual ~Layout(); | ||||||
|  |  | ||||||
|   // Handlers for wayland events |   // Handlers for wayland events | ||||||
|   void handle_name(const char *name); |   void handle_name(const char *name); | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ namespace waybar::modules::river { | |||||||
| class Mode : public waybar::ALabel { | class Mode : public waybar::ALabel { | ||||||
|  public: |  public: | ||||||
|   Mode(const std::string &, const waybar::Bar &, const Json::Value &); |   Mode(const std::string &, const waybar::Bar &, const Json::Value &); | ||||||
|   ~Mode(); |   virtual ~Mode(); | ||||||
|  |  | ||||||
|   // Handlers for wayland events |   // Handlers for wayland events | ||||||
|   void handle_mode(const char *mode); |   void handle_mode(const char *mode); | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ namespace waybar::modules::river { | |||||||
| class Tags : public waybar::AModule { | class Tags : public waybar::AModule { | ||||||
|  public: |  public: | ||||||
|   Tags(const std::string &, const waybar::Bar &, const Json::Value &); |   Tags(const std::string &, const waybar::Bar &, const Json::Value &); | ||||||
|   ~Tags(); |   virtual ~Tags(); | ||||||
|  |  | ||||||
|   // Handlers for wayland events |   // Handlers for wayland events | ||||||
|   void handle_focused_tags(uint32_t tags); |   void handle_focused_tags(uint32_t tags); | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ namespace waybar::modules::river { | |||||||
| class Window : public waybar::ALabel { | class Window : public waybar::ALabel { | ||||||
|  public: |  public: | ||||||
|   Window(const std::string &, const waybar::Bar &, const Json::Value &); |   Window(const std::string &, const waybar::Bar &, const Json::Value &); | ||||||
|   ~Window(); |   virtual ~Window(); | ||||||
|  |  | ||||||
|   // Handlers for wayland events |   // Handlers for wayland events | ||||||
|   void handle_focused_view(const char *title); |   void handle_focused_view(const char *title); | ||||||
|   | |||||||
| @@ -10,8 +10,8 @@ namespace waybar::modules { | |||||||
| class Clock : public ALabel { | class Clock : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Clock(const std::string&, const Json::Value&); |   Clock(const std::string&, const Json::Value&); | ||||||
|   ~Clock() = default; |   virtual ~Clock() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   util::SleeperThread thread_; |   util::SleeperThread thread_; | ||||||
|   | |||||||
| @@ -12,12 +12,12 @@ namespace waybar::modules { | |||||||
| class Sndio : public ALabel { | class Sndio : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Sndio(const std::string &, const Json::Value &); |   Sndio(const std::string &, const Json::Value &); | ||||||
|   ~Sndio(); |   virtual ~Sndio(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|   auto set_desc(struct sioctl_desc *, unsigned int) -> void; |   auto set_desc(struct sioctl_desc *, unsigned int) -> void; | ||||||
|   auto put_val(unsigned int, unsigned int) -> void; |   auto put_val(unsigned int, unsigned int) -> void; | ||||||
|   bool handleScroll(GdkEventScroll *); |   bool handleScroll(GdkEventScroll *) override; | ||||||
|   bool handleToggle(GdkEventButton *const &); |   bool handleToggle(GdkEventButton *const &) override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   auto connect_to_sndio() -> void; |   auto connect_to_sndio() -> void; | ||||||
|   | |||||||
| @@ -13,8 +13,8 @@ namespace waybar::modules::SNI { | |||||||
| class Tray : public AModule { | class Tray : public AModule { | ||||||
|  public: |  public: | ||||||
|   Tray(const std::string&, const Bar&, const Json::Value&); |   Tray(const std::string&, const Bar&, const Json::Value&); | ||||||
|   ~Tray() = default; |   virtual ~Tray() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void onAdd(std::unique_ptr<Item>& item); |   void onAdd(std::unique_ptr<Item>& item); | ||||||
|   | |||||||
| @@ -17,8 +17,8 @@ namespace waybar::modules::sway { | |||||||
| class Language : public ALabel, public sigc::trackable { | class Language : public ALabel, public sigc::trackable { | ||||||
|  public: |  public: | ||||||
|   Language(const std::string& id, const Json::Value& config); |   Language(const std::string& id, const Json::Value& config); | ||||||
|   ~Language() = default; |   virtual ~Language() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   enum class DispayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 }; |   enum class DispayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 }; | ||||||
|   | |||||||
| @@ -13,8 +13,8 @@ namespace waybar::modules::sway { | |||||||
| class Mode : public ALabel, public sigc::trackable { | class Mode : public ALabel, public sigc::trackable { | ||||||
|  public: |  public: | ||||||
|   Mode(const std::string&, const Json::Value&); |   Mode(const std::string&, const Json::Value&); | ||||||
|   ~Mode() = default; |   virtual ~Mode() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void onEvent(const struct Ipc::ipc_response&); |   void onEvent(const struct Ipc::ipc_response&); | ||||||
|   | |||||||
| @@ -15,8 +15,8 @@ namespace waybar::modules::sway { | |||||||
| class Scratchpad : public ALabel { | class Scratchpad : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Scratchpad(const std::string&, const Json::Value&); |   Scratchpad(const std::string&, const Json::Value&); | ||||||
|   ~Scratchpad() = default; |   virtual ~Scratchpad() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   auto getTree() -> void; |   auto getTree() -> void; | ||||||
| @@ -32,4 +32,4 @@ class Scratchpad : public ALabel { | |||||||
|   Ipc ipc_; |   Ipc ipc_; | ||||||
|   util::JsonParser parser_; |   util::JsonParser parser_; | ||||||
| }; | }; | ||||||
| }  // namespace waybar::modules::sway | }  // namespace waybar::modules::sway | ||||||
|   | |||||||
| @@ -15,8 +15,8 @@ namespace waybar::modules::sway { | |||||||
| class Window : public AIconLabel, public sigc::trackable { | class Window : public AIconLabel, public sigc::trackable { | ||||||
|  public: |  public: | ||||||
|   Window(const std::string&, const waybar::Bar&, const Json::Value&); |   Window(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~Window() = default; |   virtual ~Window() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void setClass(std::string classname, bool enable); |   void setClass(std::string classname, bool enable); | ||||||
|   | |||||||
| @@ -18,8 +18,8 @@ namespace waybar::modules::sway { | |||||||
| class Workspaces : public AModule, public sigc::trackable { | class Workspaces : public AModule, public sigc::trackable { | ||||||
|  public: |  public: | ||||||
|   Workspaces(const std::string&, const waybar::Bar&, const Json::Value&); |   Workspaces(const std::string&, const waybar::Bar&, const Json::Value&); | ||||||
|   ~Workspaces() = default; |   virtual ~Workspaces() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   static constexpr std::string_view workspace_switch_cmd_ = "workspace {} \"{}\""; |   static constexpr std::string_view workspace_switch_cmd_ = "workspace {} \"{}\""; | ||||||
| @@ -37,7 +37,7 @@ class Workspaces : public AModule, public sigc::trackable { | |||||||
|   const std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const; |   const std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const; | ||||||
|   uint16_t getWorkspaceIndex(const std::string& name) const; |   uint16_t getWorkspaceIndex(const std::string& name) const; | ||||||
|   std::string trimWorkspaceName(std::string); |   std::string trimWorkspaceName(std::string); | ||||||
|   bool handleScroll(GdkEventScroll*); |   bool handleScroll(GdkEventScroll*) override; | ||||||
|  |  | ||||||
|   const Bar& bar_; |   const Bar& bar_; | ||||||
|   std::vector<Json::Value> workspaces_; |   std::vector<Json::Value> workspaces_; | ||||||
|   | |||||||
| @@ -12,8 +12,8 @@ namespace waybar::modules { | |||||||
| class Temperature : public ALabel { | class Temperature : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Temperature(const std::string&, const Json::Value&); |   Temperature(const std::string&, const Json::Value&); | ||||||
|   ~Temperature() = default; |   virtual ~Temperature() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   float getTemperature(); |   float getTemperature(); | ||||||
|   | |||||||
| @@ -19,8 +19,8 @@ namespace waybar::modules::upower { | |||||||
| class UPower : public AModule { | class UPower : public AModule { | ||||||
|  public: |  public: | ||||||
|   UPower(const std::string &, const Json::Value &); |   UPower(const std::string &, const Json::Value &); | ||||||
|   ~UPower(); |   virtual ~UPower(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   typedef std::unordered_map<std::string, UpDevice *> Devices; |   typedef std::unordered_map<std::string, UpDevice *> Devices; | ||||||
| @@ -45,7 +45,7 @@ class UPower : public AModule { | |||||||
|   void resetDevices(); |   void resetDevices(); | ||||||
|   void removeDevices(); |   void removeDevices(); | ||||||
|   bool show_tooltip_callback(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &tooltip); |   bool show_tooltip_callback(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &tooltip); | ||||||
|   bool handleToggle(GdkEventButton *const &); |   bool handleToggle(GdkEventButton *const &) override; | ||||||
|   std::string timeToString(gint64 time); |   std::string timeToString(gint64 time); | ||||||
|  |  | ||||||
|   const std::string getDeviceStatus(UpDeviceState &state); |   const std::string getDeviceStatus(UpDeviceState &state); | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ class UPowerTooltip : public Gtk::Window { | |||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   UPowerTooltip(uint iconSize, uint tooltipSpacing, uint tooltipPadding); |   UPowerTooltip(uint iconSize, uint tooltipSpacing, uint tooltipPadding); | ||||||
|   ~UPowerTooltip(); |   virtual ~UPowerTooltip(); | ||||||
|  |  | ||||||
|   uint updateTooltip(Devices& devices); |   uint updateTooltip(Devices& devices); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -11,8 +11,8 @@ namespace waybar::modules { | |||||||
| class User : public AIconLabel { | class User : public AIconLabel { | ||||||
|  public: |  public: | ||||||
|   User(const std::string&, const Json::Value&); |   User(const std::string&, const Json::Value&); | ||||||
|   ~User() = default; |   virtual ~User() = default; | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|   bool handleToggle(GdkEventButton* const& e) override; |   bool handleToggle(GdkEventButton* const& e) override; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,8 +13,8 @@ namespace waybar::modules { | |||||||
| class Wireplumber : public ALabel { | class Wireplumber : public ALabel { | ||||||
|  public: |  public: | ||||||
|   Wireplumber(const std::string&, const Json::Value&); |   Wireplumber(const std::string&, const Json::Value&); | ||||||
|   ~Wireplumber(); |   virtual ~Wireplumber(); | ||||||
|   auto update() -> void; |   auto update() -> void override; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   void loadRequiredApiModules(); |   void loadRequiredApiModules(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Viktar Lukashonak
					Viktar Lukashonak