2019-02-10 02:35:19 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-10-15 16:14:06 -03:00
|
|
|
#include <memory>
|
2019-02-10 02:35:19 -07:00
|
|
|
#include <optional>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <string_view>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2022-11-24 12:28:52 +01:00
|
|
|
#include "ALabel.hpp"
|
2023-10-15 16:14:06 -03:00
|
|
|
#include "util/backlight_backend.hpp"
|
2019-02-10 02:35:19 -07:00
|
|
|
#include "util/json.hpp"
|
|
|
|
|
|
|
|
|
|
struct udev;
|
|
|
|
|
struct udev_device;
|
|
|
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
|
2022-11-24 12:28:52 +01:00
|
|
|
class Backlight : public ALabel {
|
2019-04-18 17:52:00 +02:00
|
|
|
public:
|
2026-02-04 09:24:14 +01:00
|
|
|
Backlight(const std::string&, const Json::Value&);
|
2023-10-15 16:14:06 -03:00
|
|
|
virtual ~Backlight() = default;
|
2023-03-02 16:57:07 +03:00
|
|
|
auto update() -> void override;
|
2019-02-10 02:35:19 -07:00
|
|
|
|
2026-02-04 09:24:14 +01:00
|
|
|
bool handleScroll(GdkEventScroll* e) override;
|
2023-02-01 14:40:36 +01:00
|
|
|
|
2022-04-06 08:37:19 +02:00
|
|
|
const std::string preferred_device_;
|
2019-02-10 02:35:19 -07:00
|
|
|
|
2022-04-06 08:37:19 +02:00
|
|
|
std::string previous_format_;
|
2019-02-25 20:05:44 -07:00
|
|
|
|
2023-10-15 16:14:06 -03:00
|
|
|
util::BacklightBackend backend;
|
2019-02-10 02:35:19 -07:00
|
|
|
};
|
2019-04-18 17:52:00 +02:00
|
|
|
} // namespace waybar::modules
|