chore: upgrade to clang-format@21
This commit is contained in:
@ -12,7 +12,7 @@ namespace waybar::modules {
|
||||
|
||||
class UPower final : public AIconLabel {
|
||||
public:
|
||||
UPower(const std::string &, const Json::Value &);
|
||||
UPower(const std::string&, const Json::Value&);
|
||||
virtual ~UPower();
|
||||
auto update() -> void override;
|
||||
|
||||
@ -30,17 +30,17 @@ class UPower final : public AIconLabel {
|
||||
|
||||
// UPower device info
|
||||
struct upDevice_output {
|
||||
UpDevice *upDevice{NULL};
|
||||
UpDevice* upDevice{NULL};
|
||||
double percentage{0.0};
|
||||
double temperature{0.0};
|
||||
guint64 time_full{0u};
|
||||
guint64 time_empty{0u};
|
||||
gchar *icon_name{(char *)'\0'};
|
||||
gchar* icon_name{(char*)'\0'};
|
||||
bool upDeviceValid{false};
|
||||
UpDeviceState state;
|
||||
UpDeviceKind kind;
|
||||
char *nativePath{(char *)'\0'};
|
||||
char *model{(char *)'\0'};
|
||||
char* nativePath{(char*)'\0'};
|
||||
char* model{(char*)'\0'};
|
||||
};
|
||||
|
||||
// Technical variables
|
||||
@ -53,13 +53,13 @@ class UPower final : public AIconLabel {
|
||||
bool sleeping_;
|
||||
|
||||
// Technical functions
|
||||
void addDevice(UpDevice *);
|
||||
void removeDevice(const gchar *);
|
||||
void addDevice(UpDevice*);
|
||||
void removeDevice(const gchar*);
|
||||
void removeDevices();
|
||||
void resetDevices();
|
||||
void setDisplayDevice();
|
||||
const Glib::ustring getText(const upDevice_output &upDevice_, const std::string &format);
|
||||
bool queryTooltipCb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &);
|
||||
const Glib::ustring getText(const upDevice_output& upDevice_, const std::string& format);
|
||||
bool queryTooltipCb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip>&);
|
||||
|
||||
// DBUS variables
|
||||
guint watcherID_;
|
||||
@ -67,28 +67,28 @@ class UPower final : public AIconLabel {
|
||||
guint subscrID_{0u};
|
||||
|
||||
// UPower variables
|
||||
UpClient *upClient_;
|
||||
UpClient* upClient_;
|
||||
upDevice_output upDevice_; // Device to display
|
||||
typedef std::unordered_map<std::string, upDevice_output> Devices;
|
||||
Devices devices_;
|
||||
bool upRunning_{true};
|
||||
|
||||
// DBus callbacks
|
||||
void getConn_cb(Glib::RefPtr<Gio::AsyncResult> &result);
|
||||
void onAppear(const Glib::RefPtr<Gio::DBus::Connection> &, const Glib::ustring &,
|
||||
const Glib::ustring &);
|
||||
void onVanished(const Glib::RefPtr<Gio::DBus::Connection> &, const Glib::ustring &);
|
||||
void prepareForSleep_cb(const Glib::RefPtr<Gio::DBus::Connection> &connection,
|
||||
const Glib::ustring &sender_name, const Glib::ustring &object_path,
|
||||
const Glib::ustring &interface_name, const Glib::ustring &signal_name,
|
||||
const Glib::VariantContainerBase ¶meters);
|
||||
void getConn_cb(Glib::RefPtr<Gio::AsyncResult>& result);
|
||||
void onAppear(const Glib::RefPtr<Gio::DBus::Connection>&, const Glib::ustring&,
|
||||
const Glib::ustring&);
|
||||
void onVanished(const Glib::RefPtr<Gio::DBus::Connection>&, const Glib::ustring&);
|
||||
void prepareForSleep_cb(const Glib::RefPtr<Gio::DBus::Connection>& connection,
|
||||
const Glib::ustring& sender_name, const Glib::ustring& object_path,
|
||||
const Glib::ustring& interface_name, const Glib::ustring& signal_name,
|
||||
const Glib::VariantContainerBase& parameters);
|
||||
|
||||
// UPower callbacks
|
||||
static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data);
|
||||
static void deviceRemoved_cb(UpClient *client, const gchar *objectPath, gpointer data);
|
||||
static void deviceNotify_cb(UpDevice *device, GParamSpec *pspec, gpointer user_data);
|
||||
static void deviceAdded_cb(UpClient* client, UpDevice* device, gpointer data);
|
||||
static void deviceRemoved_cb(UpClient* client, const gchar* objectPath, gpointer data);
|
||||
static void deviceNotify_cb(UpDevice* device, GParamSpec* pspec, gpointer user_data);
|
||||
// UPower secondary functions
|
||||
void getUpDeviceInfo(upDevice_output &upDevice_);
|
||||
void getUpDeviceInfo(upDevice_output& upDevice_);
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
Reference in New Issue
Block a user