mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
b8322c4b4b
The AButton class is designed as full a substitute to ALabel. The GtkButton attribute 'button_' is initialized with a label. This label can the be referenced by the subsequent inheritors of AButton instead of the GtkLabel attribute 'label_' of ALabel. For convenience a GtkLabel* 'label_' attribute is added to AButton. If the button cannot be clicked it is disabled, effectively acting like its label predecessor. GtkButton seems to catch one-click mouse events regardless of the flags set on it. Therefore, 'signal_pressed' is connected to a function creating a fake GdkEventButton* and calling 'handleToggle' (for details on this possible bug in GTK see: https://stackoverflow.com/questions/45334911 ) In accordance with other GtkButtons (i.e. the sway/workspace ones) set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
91 lines
2.0 KiB
C++
91 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <json/json.h>
|
|
#ifdef HAVE_LIBDATE
|
|
#include "modules/clock.hpp"
|
|
#else
|
|
#include "modules/simpleclock.hpp"
|
|
#endif
|
|
#ifdef HAVE_SWAY
|
|
#include "modules/sway/language.hpp"
|
|
#include "modules/sway/mode.hpp"
|
|
#include "modules/sway/window.hpp"
|
|
#include "modules/sway/workspaces.hpp"
|
|
#endif
|
|
#ifdef HAVE_WLR
|
|
#include "modules/wlr/taskbar.hpp"
|
|
#include "modules/wlr/workspace_manager.hpp"
|
|
#endif
|
|
#ifdef HAVE_RIVER
|
|
#include "modules/river/mode.hpp"
|
|
#include "modules/river/tags.hpp"
|
|
#include "modules/river/window.hpp"
|
|
#endif
|
|
#ifdef HAVE_HYPRLAND
|
|
#include "modules/hyprland/backend.hpp"
|
|
#include "modules/hyprland/language.hpp"
|
|
#include "modules/hyprland/window.hpp"
|
|
#endif
|
|
#if defined(__linux__) && !defined(NO_FILESYSTEM)
|
|
#include "modules/battery.hpp"
|
|
#endif
|
|
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
|
#include "modules/cpu.hpp"
|
|
#endif
|
|
#include "modules/idle_inhibitor.hpp"
|
|
#if defined(HAVE_MEMORY_LINUX) || defined(HAVE_MEMORY_BSD)
|
|
#include "modules/memory.hpp"
|
|
#endif
|
|
#include "modules/disk.hpp"
|
|
#ifdef HAVE_DBUSMENU
|
|
#include "modules/sni/tray.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBNL
|
|
#include "modules/network.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBUDEV
|
|
#include "modules/backlight.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBEVDEV
|
|
#include "modules/keyboard_state.hpp"
|
|
#endif
|
|
#ifdef HAVE_GAMEMODE
|
|
#include "modules/gamemode.hpp"
|
|
#endif
|
|
#ifdef HAVE_UPOWER
|
|
#include "modules/upower/upower.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBPULSE
|
|
#include "modules/pulseaudio.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBMPDCLIENT
|
|
#include "modules/mpd/mpd.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBSNDIO
|
|
#include "modules/sndio.hpp"
|
|
#endif
|
|
#ifdef HAVE_GIO_UNIX
|
|
#include "modules/bluetooth.hpp"
|
|
#include "modules/inhibitor.hpp"
|
|
#endif
|
|
#ifdef HAVE_LIBJACK
|
|
#include "modules/jack.hpp"
|
|
#endif
|
|
#include "bar.hpp"
|
|
#include "modules/custom.hpp"
|
|
#include "modules/temperature.hpp"
|
|
|
|
namespace waybar {
|
|
|
|
class Factory {
|
|
public:
|
|
Factory(const Bar& bar, const Json::Value& config);
|
|
AModule* makeModule(const std::string& name) const;
|
|
|
|
private:
|
|
const Bar& bar_;
|
|
const Json::Value& config_;
|
|
};
|
|
|
|
} // namespace waybar
|