chore: upgrade to clang-format@21
This commit is contained in:
@ -17,11 +17,11 @@ namespace waybar::modules {
|
||||
|
||||
class Backlight : public ALabel {
|
||||
public:
|
||||
Backlight(const std::string &, const Json::Value &);
|
||||
Backlight(const std::string&, const Json::Value&);
|
||||
virtual ~Backlight() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
bool handleScroll(GdkEventScroll *e) override;
|
||||
bool handleScroll(GdkEventScroll* e) override;
|
||||
|
||||
const std::string preferred_device_;
|
||||
|
||||
|
||||
@ -12,23 +12,23 @@ namespace waybar::modules::dwl {
|
||||
|
||||
class Tags : public waybar::AModule {
|
||||
public:
|
||||
Tags(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Tags(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Tags();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint32_t focused);
|
||||
|
||||
void handle_primary_clicked(uint32_t tag);
|
||||
bool handle_button_press(GdkEventButton *event_button, uint32_t tag);
|
||||
bool handle_button_press(GdkEventButton* event_button, uint32_t tag);
|
||||
|
||||
struct zdwl_ipc_manager_v2 *status_manager_;
|
||||
struct wl_seat *seat_;
|
||||
struct zdwl_ipc_manager_v2* status_manager_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
const waybar::Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
std::vector<Gtk::Button> buttons_;
|
||||
struct zdwl_ipc_output_v2 *output_status_;
|
||||
struct zdwl_ipc_output_v2* output_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::dwl */
|
||||
|
||||
@ -13,26 +13,26 @@ namespace waybar::modules::dwl {
|
||||
|
||||
class Window : public AAppIconLabel, public sigc::trackable {
|
||||
public:
|
||||
Window(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Window();
|
||||
|
||||
void handle_layout(const uint32_t layout);
|
||||
void handle_title(const char *title);
|
||||
void handle_appid(const char *ppid);
|
||||
void handle_layout_symbol(const char *layout_symbol);
|
||||
void handle_title(const char* title);
|
||||
void handle_appid(const char* ppid);
|
||||
void handle_layout_symbol(const char* layout_symbol);
|
||||
void handle_frame();
|
||||
|
||||
struct zdwl_ipc_manager_v2 *status_manager_;
|
||||
struct zdwl_ipc_manager_v2* status_manager_;
|
||||
|
||||
private:
|
||||
const Bar &bar_;
|
||||
const Bar& bar_;
|
||||
|
||||
std::string title_;
|
||||
std::string appid_;
|
||||
std::string layout_symbol_;
|
||||
uint32_t layout_;
|
||||
|
||||
struct zdwl_ipc_output_v2 *output_status_;
|
||||
struct zdwl_ipc_output_v2* output_status_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::dwl
|
||||
|
||||
@ -20,16 +20,16 @@ class Workspace;
|
||||
|
||||
class WorkspaceManager final : public AModule {
|
||||
public:
|
||||
WorkspaceManager(const std::string &id, const waybar::Bar &bar, const Json::Value &config);
|
||||
WorkspaceManager(const std::string& id, const waybar::Bar& bar, const Json::Value& config);
|
||||
~WorkspaceManager() override;
|
||||
void register_manager(wl_registry *registry, uint32_t name, uint32_t version);
|
||||
void register_manager(wl_registry* registry, uint32_t name, uint32_t version);
|
||||
void remove_workspace_group(uint32_t id);
|
||||
void remove_workspace(uint32_t id);
|
||||
void set_needs_sorting() { needs_sorting_ = true; }
|
||||
|
||||
// wl events
|
||||
void handle_workspace_group(ext_workspace_group_handle_v1 *handle);
|
||||
void handle_workspace(ext_workspace_handle_v1 *handle);
|
||||
void handle_workspace_group(ext_workspace_group_handle_v1* handle);
|
||||
void handle_workspace(ext_workspace_handle_v1* handle);
|
||||
void handle_done();
|
||||
void handle_finished();
|
||||
|
||||
@ -38,7 +38,7 @@ class WorkspaceManager final : public AModule {
|
||||
|
||||
private:
|
||||
void update() override;
|
||||
bool has_button(const Gtk::Button *button);
|
||||
bool has_button(const Gtk::Button* button);
|
||||
void sort_workspaces();
|
||||
void clear_buttons();
|
||||
void update_buttons();
|
||||
@ -52,10 +52,10 @@ class WorkspaceManager final : public AModule {
|
||||
bool sort_by_coordinates_ = false;
|
||||
bool all_outputs_ = false;
|
||||
|
||||
const waybar::Bar &bar_;
|
||||
const waybar::Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
|
||||
ext_workspace_manager_v1 *ext_manager_ = nullptr;
|
||||
ext_workspace_manager_v1* ext_manager_ = nullptr;
|
||||
std::vector<std::unique_ptr<WorkspaceGroup>> groups_;
|
||||
std::vector<std::unique_ptr<Workspace>> workspaces_;
|
||||
|
||||
@ -64,60 +64,60 @@ class WorkspaceManager final : public AModule {
|
||||
|
||||
class WorkspaceGroup {
|
||||
public:
|
||||
WorkspaceGroup(WorkspaceManager &manager, ext_workspace_group_handle_v1 *handle, uint32_t id);
|
||||
WorkspaceGroup(WorkspaceManager& manager, ext_workspace_group_handle_v1* handle, uint32_t id);
|
||||
~WorkspaceGroup();
|
||||
|
||||
u_int32_t id() const { return id_; }
|
||||
bool has_output(const wl_output *output);
|
||||
bool has_workspace(const ext_workspace_handle_v1 *workspace);
|
||||
bool has_output(const wl_output* output);
|
||||
bool has_workspace(const ext_workspace_handle_v1* workspace);
|
||||
|
||||
// wl events
|
||||
void handle_capabilities(uint32_t capabilities);
|
||||
void handle_output_enter(wl_output *output);
|
||||
void handle_output_leave(wl_output *output);
|
||||
void handle_workspace_enter(ext_workspace_handle_v1 *handle);
|
||||
void handle_workspace_leave(ext_workspace_handle_v1 *handle);
|
||||
void handle_output_enter(wl_output* output);
|
||||
void handle_output_leave(wl_output* output);
|
||||
void handle_workspace_enter(ext_workspace_handle_v1* handle);
|
||||
void handle_workspace_leave(ext_workspace_handle_v1* handle);
|
||||
void handle_removed();
|
||||
|
||||
private:
|
||||
WorkspaceManager &workspaces_manager_;
|
||||
ext_workspace_group_handle_v1 *ext_handle_;
|
||||
WorkspaceManager& workspaces_manager_;
|
||||
ext_workspace_group_handle_v1* ext_handle_;
|
||||
uint32_t id_;
|
||||
std::vector<wl_output *> outputs_;
|
||||
std::vector<ext_workspace_handle_v1 *> workspaces_;
|
||||
std::vector<wl_output*> outputs_;
|
||||
std::vector<ext_workspace_handle_v1*> workspaces_;
|
||||
};
|
||||
|
||||
class Workspace {
|
||||
public:
|
||||
Workspace(const Json::Value &config, WorkspaceManager &manager, ext_workspace_handle_v1 *handle,
|
||||
uint32_t id, const std::string &name);
|
||||
Workspace(const Json::Value& config, WorkspaceManager& manager, ext_workspace_handle_v1* handle,
|
||||
uint32_t id, const std::string& name);
|
||||
~Workspace();
|
||||
|
||||
ext_workspace_handle_v1 *handle() const { return ext_handle_; }
|
||||
ext_workspace_handle_v1* handle() const { return ext_handle_; }
|
||||
u_int32_t id() const { return id_; }
|
||||
std::string &workspace_id() { return workspace_id_; }
|
||||
std::string &name() { return name_; }
|
||||
std::vector<u_int32_t> &coordinates() { return coordinates_; }
|
||||
Gtk::Button &button() { return button_; }
|
||||
std::string& workspace_id() { return workspace_id_; }
|
||||
std::string& name() { return name_; }
|
||||
std::vector<u_int32_t>& coordinates() { return coordinates_; }
|
||||
Gtk::Button& button() { return button_; }
|
||||
void update();
|
||||
|
||||
// wl events
|
||||
void handle_id(const std::string &id);
|
||||
void handle_name(const std::string &name);
|
||||
void handle_coordinates(const std::vector<uint32_t> &coordinates);
|
||||
void handle_id(const std::string& id);
|
||||
void handle_name(const std::string& name);
|
||||
void handle_coordinates(const std::vector<uint32_t>& coordinates);
|
||||
void handle_state(uint32_t state);
|
||||
void handle_capabilities(uint32_t capabilities);
|
||||
void handle_removed();
|
||||
|
||||
// gdk events
|
||||
bool handle_clicked(const GdkEventButton *button) const;
|
||||
bool handle_clicked(const GdkEventButton* button) const;
|
||||
|
||||
private:
|
||||
bool has_state(uint32_t state) const { return (state_ & state) == state; }
|
||||
std::string icon();
|
||||
|
||||
WorkspaceManager &workspace_manager_;
|
||||
ext_workspace_handle_v1 *ext_handle_ = nullptr;
|
||||
WorkspaceManager& workspace_manager_;
|
||||
ext_workspace_handle_v1* ext_handle_ = nullptr;
|
||||
uint32_t id_;
|
||||
uint32_t state_ = 0;
|
||||
std::string workspace_id_;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#include "ext-workspace-v1-client-protocol.h"
|
||||
|
||||
namespace waybar::modules::ext {
|
||||
void add_registry_listener(void *data);
|
||||
void add_workspace_listener(ext_workspace_handle_v1 *workspace_handle, void *data);
|
||||
void add_workspace_group_listener(ext_workspace_group_handle_v1 *workspace_group_handle,
|
||||
void *data);
|
||||
ext_workspace_manager_v1 *workspace_manager_bind(wl_registry *registry, uint32_t name,
|
||||
uint32_t version, void *data);
|
||||
void add_registry_listener(void* data);
|
||||
void add_workspace_listener(ext_workspace_handle_v1* workspace_handle, void* data);
|
||||
void add_workspace_group_listener(ext_workspace_group_handle_v1* workspace_group_handle,
|
||||
void* data);
|
||||
ext_workspace_manager_v1* workspace_manager_bind(wl_registry* registry, uint32_t name,
|
||||
uint32_t version, void* data);
|
||||
} // namespace waybar::modules::ext
|
||||
|
||||
@ -17,7 +17,7 @@ namespace waybar::modules {
|
||||
|
||||
class Gamemode : public AModule {
|
||||
public:
|
||||
Gamemode(const std::string &, const Json::Value &);
|
||||
Gamemode(const std::string&, const Json::Value&);
|
||||
virtual ~Gamemode();
|
||||
auto update() -> void override;
|
||||
|
||||
@ -28,18 +28,18 @@ class Gamemode : public AModule {
|
||||
const std::string DEFAULT_TOOLTIP_FORMAT = "Games running: {count}";
|
||||
const std::string DEFAULT_GLYPH = "";
|
||||
|
||||
void appear(const Glib::RefPtr<Gio::DBus::Connection> &connection, const Glib::ustring &name,
|
||||
const Glib::ustring &name_owner);
|
||||
void disappear(const Glib::RefPtr<Gio::DBus::Connection> &connection, const Glib::ustring &name);
|
||||
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 notify_cb(const Glib::ustring &sender_name, const Glib::ustring &signal_name,
|
||||
const Glib::VariantContainerBase &arguments);
|
||||
void appear(const Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring& name,
|
||||
const Glib::ustring& name_owner);
|
||||
void disappear(const Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring& name);
|
||||
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);
|
||||
void notify_cb(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
|
||||
const Glib::VariantContainerBase& arguments);
|
||||
|
||||
void getData();
|
||||
bool handleToggle(GdkEventButton *const &) override;
|
||||
bool handleToggle(GdkEventButton* const&) override;
|
||||
|
||||
// Config
|
||||
std::string format = DEFAULT_FORMAT;
|
||||
|
||||
@ -13,7 +13,7 @@ namespace waybar::modules {
|
||||
|
||||
class JACK : public ALabel {
|
||||
public:
|
||||
JACK(const std::string &, const Json::Value &);
|
||||
JACK(const std::string&, const Json::Value&);
|
||||
virtual ~JACK() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
@ -25,7 +25,7 @@ class JACK : public ALabel {
|
||||
private:
|
||||
std::string JACKState();
|
||||
|
||||
jack_client_t *client_;
|
||||
jack_client_t* client_;
|
||||
jack_nframes_t bufsize_;
|
||||
jack_nframes_t samplerate_;
|
||||
unsigned int xruns_;
|
||||
@ -38,7 +38,7 @@ class JACK : public ALabel {
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
int bufSizeCallback(jack_nframes_t size, void *obj);
|
||||
int sampleRateCallback(jack_nframes_t rate, void *obj);
|
||||
int xrunCallback(void *obj);
|
||||
void shutdownCallback(void *obj);
|
||||
int bufSizeCallback(jack_nframes_t size, void* obj);
|
||||
int sampleRateCallback(jack_nframes_t rate, void* obj);
|
||||
int xrunCallback(void* obj);
|
||||
void shutdownCallback(void* obj);
|
||||
|
||||
@ -10,13 +10,13 @@ namespace waybar::modules::niri {
|
||||
|
||||
class Language : public ALabel, public EventHandler {
|
||||
public:
|
||||
Language(const std::string &, const Bar &, const Json::Value &);
|
||||
Language(const std::string&, const Bar&, const Json::Value&);
|
||||
~Language() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void updateFromIPC();
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void onEvent(const Json::Value& ev) override;
|
||||
void doUpdate();
|
||||
|
||||
struct Layout {
|
||||
@ -26,10 +26,10 @@ class Language : public ALabel, public EventHandler {
|
||||
std::string short_description;
|
||||
};
|
||||
|
||||
static Layout getLayout(const std::string &fullName);
|
||||
static Layout getLayout(const std::string& fullName);
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar &bar_;
|
||||
const Bar& bar_;
|
||||
|
||||
std::vector<Layout> layouts_;
|
||||
unsigned current_idx_;
|
||||
|
||||
@ -11,16 +11,16 @@ namespace waybar::modules::niri {
|
||||
|
||||
class Window : public AAppIconLabel, public EventHandler {
|
||||
public:
|
||||
Window(const std::string &, const Bar &, const Json::Value &);
|
||||
Window(const std::string&, const Bar&, const Json::Value&);
|
||||
~Window() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void onEvent(const Json::Value& ev) override;
|
||||
void doUpdate();
|
||||
void setClass(const std::string &className, bool enable);
|
||||
void setClass(const std::string& className, bool enable);
|
||||
|
||||
const Bar &bar_;
|
||||
const Bar& bar_;
|
||||
|
||||
std::string oldAppId_;
|
||||
};
|
||||
|
||||
@ -11,17 +11,17 @@ namespace waybar::modules::niri {
|
||||
|
||||
class Workspaces : public AModule, public EventHandler {
|
||||
public:
|
||||
Workspaces(const std::string &, const Bar &, const Json::Value &);
|
||||
Workspaces(const std::string&, const Bar&, const Json::Value&);
|
||||
~Workspaces() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void onEvent(const Json::Value& ev) override;
|
||||
void doUpdate();
|
||||
Gtk::Button &addButton(const Json::Value &ws);
|
||||
std::string getIcon(const std::string &value, const Json::Value &ws);
|
||||
Gtk::Button& addButton(const Json::Value& ws);
|
||||
std::string getIcon(const std::string& value, const Json::Value& ws);
|
||||
|
||||
const Bar &bar_;
|
||||
const Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
// Map from niri workspace id to button.
|
||||
std::unordered_map<uint64_t, Gtk::Button> buttons_;
|
||||
|
||||
@ -16,15 +16,15 @@ struct Profile {
|
||||
|
||||
class PowerProfilesDaemon : public ALabel {
|
||||
public:
|
||||
PowerProfilesDaemon(const std::string &, const Json::Value &);
|
||||
PowerProfilesDaemon(const std::string&, const Json::Value&);
|
||||
auto update() -> void override;
|
||||
void profileChangedCb(const Gio::DBus::Proxy::MapChangedProperties &,
|
||||
const std::vector<Glib::ustring> &);
|
||||
void busConnectedCb(Glib::RefPtr<Gio::AsyncResult> &r);
|
||||
void getAllPropsCb(Glib::RefPtr<Gio::AsyncResult> &r);
|
||||
void setPropCb(Glib::RefPtr<Gio::AsyncResult> &r);
|
||||
void profileChangedCb(const Gio::DBus::Proxy::MapChangedProperties&,
|
||||
const std::vector<Glib::ustring>&);
|
||||
void busConnectedCb(Glib::RefPtr<Gio::AsyncResult>& r);
|
||||
void getAllPropsCb(Glib::RefPtr<Gio::AsyncResult>& r);
|
||||
void setPropCb(Glib::RefPtr<Gio::AsyncResult>& r);
|
||||
void populateInitState();
|
||||
bool handleToggle(GdkEventButton *const &e) override;
|
||||
bool handleToggle(GdkEventButton* const& e) override;
|
||||
|
||||
private:
|
||||
// True if we're connected to the dbug interface. False if we're
|
||||
@ -32,7 +32,7 @@ class PowerProfilesDaemon : public ALabel {
|
||||
bool connected_;
|
||||
// Look for a profile name in the list of available profiles and
|
||||
// switch activeProfile_ to it.
|
||||
void switchToProfile(std::string const &);
|
||||
void switchToProfile(std::string const&);
|
||||
// Used to toggle/display the profiles
|
||||
std::vector<Profile> availableProfiles_;
|
||||
// Points to the active profile in the profiles list
|
||||
|
||||
@ -13,15 +13,15 @@ namespace waybar::modules::privacy {
|
||||
|
||||
class Privacy : public AModule {
|
||||
public:
|
||||
Privacy(const std::string &, const Json::Value &, Gtk::Orientation, const std::string &pos);
|
||||
Privacy(const std::string&, const Json::Value&, Gtk::Orientation, const std::string& pos);
|
||||
auto update() -> void override;
|
||||
|
||||
void onPrivacyNodesChanged();
|
||||
|
||||
private:
|
||||
std::list<PrivacyNodeInfo *> nodes_screenshare; // Screen is being shared
|
||||
std::list<PrivacyNodeInfo *> nodes_audio_in; // Application is using the microphone
|
||||
std::list<PrivacyNodeInfo *> nodes_audio_out; // Application is outputting audio
|
||||
std::list<PrivacyNodeInfo*> nodes_screenshare; // Screen is being shared
|
||||
std::list<PrivacyNodeInfo*> nodes_audio_in; // Application is using the microphone
|
||||
std::list<PrivacyNodeInfo*> nodes_audio_out; // Application is outputting audio
|
||||
|
||||
std::mutex mutex_;
|
||||
sigc::connection visibility_conn;
|
||||
|
||||
@ -16,16 +16,16 @@ namespace waybar::modules::privacy {
|
||||
|
||||
class PrivacyItem : public Gtk::Revealer {
|
||||
public:
|
||||
PrivacyItem(const Json::Value &config_, enum PrivacyNodeType privacy_type_,
|
||||
std::list<PrivacyNodeInfo *> *nodes, Gtk::Orientation orientation,
|
||||
const std::string &pos, const uint icon_size, const uint transition_duration);
|
||||
PrivacyItem(const Json::Value& config_, enum PrivacyNodeType privacy_type_,
|
||||
std::list<PrivacyNodeInfo*>* nodes, Gtk::Orientation orientation,
|
||||
const std::string& pos, const uint icon_size, const uint transition_duration);
|
||||
|
||||
enum PrivacyNodeType privacy_type;
|
||||
|
||||
void set_in_use(bool in_use);
|
||||
|
||||
private:
|
||||
std::list<PrivacyNodeInfo *> *nodes;
|
||||
std::list<PrivacyNodeInfo*>* nodes;
|
||||
|
||||
sigc::connection signal_conn;
|
||||
|
||||
|
||||
@ -10,25 +10,25 @@ namespace waybar::modules::river {
|
||||
|
||||
class Layout : public waybar::ALabel {
|
||||
public:
|
||||
Layout(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Layout(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Layout();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_name(const char *name);
|
||||
void handle_name(const char* name);
|
||||
void handle_clear();
|
||||
void handle_focused_output(struct wl_output *output);
|
||||
void handle_unfocused_output(struct wl_output *output);
|
||||
void handle_focused_output(struct wl_output* output);
|
||||
void handle_unfocused_output(struct wl_output* output);
|
||||
|
||||
struct zriver_status_manager_v1 *status_manager_;
|
||||
struct wl_seat *seat_;
|
||||
struct zriver_status_manager_v1* status_manager_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
const waybar::Bar& bar_;
|
||||
std::string name_;
|
||||
struct wl_output *output_; // stores the output this module belongs to
|
||||
struct wl_output *focused_output_; // stores the currently focused output
|
||||
struct zriver_output_status_v1 *output_status_;
|
||||
struct zriver_seat_status_v1 *seat_status_;
|
||||
struct wl_output* output_; // stores the output this module belongs to
|
||||
struct wl_output* focused_output_; // stores the currently focused output
|
||||
struct zriver_output_status_v1* output_status_;
|
||||
struct zriver_seat_status_v1* seat_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::river */
|
||||
|
||||
@ -10,19 +10,19 @@ namespace waybar::modules::river {
|
||||
|
||||
class Mode : public waybar::ALabel {
|
||||
public:
|
||||
Mode(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Mode(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Mode();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_mode(const char *mode);
|
||||
void handle_mode(const char* mode);
|
||||
|
||||
struct zriver_status_manager_v1 *status_manager_;
|
||||
struct wl_seat *seat_;
|
||||
struct zriver_status_manager_v1* status_manager_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
const waybar::Bar& bar_;
|
||||
std::string mode_;
|
||||
struct zriver_seat_status_v1 *seat_status_;
|
||||
struct zriver_seat_status_v1* seat_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::river */
|
||||
|
||||
@ -13,27 +13,27 @@ namespace waybar::modules::river {
|
||||
|
||||
class Tags : public waybar::AModule {
|
||||
public:
|
||||
Tags(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Tags(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Tags();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_focused_tags(uint32_t tags);
|
||||
void handle_view_tags(struct wl_array *tags);
|
||||
void handle_view_tags(struct wl_array* tags);
|
||||
void handle_urgent_tags(uint32_t tags);
|
||||
|
||||
void handle_show();
|
||||
void handle_primary_clicked(uint32_t tag);
|
||||
bool handle_button_press(GdkEventButton *event_button, uint32_t tag);
|
||||
bool handle_button_press(GdkEventButton* event_button, uint32_t tag);
|
||||
|
||||
struct zriver_status_manager_v1 *status_manager_;
|
||||
struct zriver_control_v1 *control_;
|
||||
struct wl_seat *seat_;
|
||||
struct zriver_status_manager_v1* status_manager_;
|
||||
struct zriver_control_v1* control_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
const waybar::Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
std::vector<Gtk::Button> buttons_;
|
||||
struct zriver_output_status_v1 *output_status_;
|
||||
struct zriver_output_status_v1* output_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::river */
|
||||
|
||||
@ -12,22 +12,22 @@ namespace waybar::modules::river {
|
||||
|
||||
class Window : public waybar::ALabel {
|
||||
public:
|
||||
Window(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Window();
|
||||
|
||||
// Handlers for wayland events
|
||||
void handle_focused_view(const char *title);
|
||||
void handle_focused_output(struct wl_output *output);
|
||||
void handle_unfocused_output(struct wl_output *output);
|
||||
void handle_focused_view(const char* title);
|
||||
void handle_focused_output(struct wl_output* output);
|
||||
void handle_unfocused_output(struct wl_output* output);
|
||||
|
||||
struct zriver_status_manager_v1 *status_manager_;
|
||||
struct wl_seat *seat_;
|
||||
struct zriver_status_manager_v1* status_manager_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
struct wl_output *output_; // stores the output this module belongs to
|
||||
struct wl_output *focused_output_; // stores the currently focused output
|
||||
struct zriver_seat_status_v1 *seat_status_;
|
||||
const waybar::Bar& bar_;
|
||||
struct wl_output* output_; // stores the output this module belongs to
|
||||
struct wl_output* focused_output_; // stores the currently focused output
|
||||
struct zriver_seat_status_v1* seat_status_;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::river */
|
||||
|
||||
@ -11,18 +11,18 @@ namespace waybar::modules {
|
||||
|
||||
class Sndio : public ALabel {
|
||||
public:
|
||||
Sndio(const std::string &, const Json::Value &);
|
||||
Sndio(const std::string&, const Json::Value&);
|
||||
virtual ~Sndio();
|
||||
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;
|
||||
bool handleScroll(GdkEventScroll *) override;
|
||||
bool handleToggle(GdkEventButton *const &) override;
|
||||
bool handleScroll(GdkEventScroll*) override;
|
||||
bool handleToggle(GdkEventButton* const&) override;
|
||||
|
||||
private:
|
||||
auto connect_to_sndio() -> void;
|
||||
util::SleeperThread thread_;
|
||||
struct sioctl_hdl *hdl_;
|
||||
struct sioctl_hdl* hdl_;
|
||||
std::vector<struct pollfd> pfds_;
|
||||
unsigned int addr_;
|
||||
unsigned int volume_, old_volume_, maxval_;
|
||||
|
||||
@ -30,27 +30,27 @@ class Watcher {
|
||||
|
||||
typedef struct {
|
||||
GfWatchType type;
|
||||
Watcher *watcher;
|
||||
gchar *service;
|
||||
gchar *bus_name;
|
||||
gchar *object_path;
|
||||
Watcher* watcher;
|
||||
gchar* service;
|
||||
gchar* bus_name;
|
||||
gchar* object_path;
|
||||
guint watch_id;
|
||||
} GfWatch;
|
||||
|
||||
void busAcquired(const Glib::RefPtr<Gio::DBus::Connection> &, Glib::ustring);
|
||||
static gboolean handleRegisterHost(Watcher *, GDBusMethodInvocation *, const gchar *);
|
||||
static gboolean handleRegisterItem(Watcher *, GDBusMethodInvocation *, const gchar *);
|
||||
static GfWatch *gfWatchFind(GSList *list, const gchar *bus_name, const gchar *object_path);
|
||||
static GfWatch *gfWatchNew(GfWatchType, const gchar *, const gchar *, const gchar *, Watcher *);
|
||||
static void nameVanished(GDBusConnection *connection, const char *name, gpointer data);
|
||||
void busAcquired(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring);
|
||||
static gboolean handleRegisterHost(Watcher*, GDBusMethodInvocation*, const gchar*);
|
||||
static gboolean handleRegisterItem(Watcher*, GDBusMethodInvocation*, const gchar*);
|
||||
static GfWatch* gfWatchFind(GSList* list, const gchar* bus_name, const gchar* object_path);
|
||||
static GfWatch* gfWatchNew(GfWatchType, const gchar*, const gchar*, const gchar*, Watcher*);
|
||||
static void nameVanished(GDBusConnection* connection, const char* name, gpointer data);
|
||||
static void gfWatchFree(gpointer data);
|
||||
|
||||
void updateRegisteredItems(SnWatcher *obj);
|
||||
void updateRegisteredItems(SnWatcher* obj);
|
||||
|
||||
uint32_t bus_name_id_;
|
||||
GSList *hosts_ = nullptr;
|
||||
GSList *items_ = nullptr;
|
||||
SnWatcher *watcher_ = nullptr;
|
||||
GSList* hosts_ = nullptr;
|
||||
GSList* items_ = nullptr;
|
||||
SnWatcher* watcher_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::SNI
|
||||
|
||||
@ -27,21 +27,21 @@ class Ipc {
|
||||
std::string payload;
|
||||
};
|
||||
|
||||
sigc::signal<void, const struct ipc_response &> signal_event;
|
||||
sigc::signal<void, const struct ipc_response &> signal_cmd;
|
||||
sigc::signal<void, const struct ipc_response&> signal_event;
|
||||
sigc::signal<void, const struct ipc_response&> signal_cmd;
|
||||
|
||||
void sendCmd(uint32_t type, const std::string &payload = "");
|
||||
void subscribe(const std::string &payload);
|
||||
void sendCmd(uint32_t type, const std::string& payload = "");
|
||||
void subscribe(const std::string& payload);
|
||||
void handleEvent();
|
||||
void setWorker(std::function<void()> &&func);
|
||||
void setWorker(std::function<void()>&& func);
|
||||
|
||||
protected:
|
||||
static inline const std::string ipc_magic_ = "i3-ipc";
|
||||
static inline const size_t ipc_header_size_ = ipc_magic_.size() + 8;
|
||||
|
||||
const std::string getSocketPath() const;
|
||||
int open(const std::string &) const;
|
||||
struct ipc_response send(int fd, uint32_t type, const std::string &payload = "");
|
||||
int open(const std::string&) const;
|
||||
struct ipc_response send(int fd, uint32_t type, const std::string& payload = "");
|
||||
struct ipc_response recv(int fd);
|
||||
|
||||
int fd_;
|
||||
|
||||
@ -10,7 +10,7 @@ namespace waybar::modules {
|
||||
|
||||
class SystemdFailedUnits : public ALabel {
|
||||
public:
|
||||
SystemdFailedUnits(const std::string &, const Json::Value &);
|
||||
SystemdFailedUnits(const std::string&, const Json::Value&);
|
||||
virtual ~SystemdFailedUnits();
|
||||
auto update() -> void override;
|
||||
|
||||
@ -24,8 +24,8 @@ class SystemdFailedUnits : public ALabel {
|
||||
std::string last_status;
|
||||
Glib::RefPtr<Gio::DBus::Proxy> system_proxy, user_proxy;
|
||||
|
||||
void notify_cb(const Glib::ustring &sender_name, const Glib::ustring &signal_name,
|
||||
const Glib::VariantContainerBase &arguments);
|
||||
void notify_cb(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
|
||||
const Glib::VariantContainerBase& arguments);
|
||||
void RequestFailedUnits();
|
||||
void RequestSystemState();
|
||||
void updateData();
|
||||
|
||||
@ -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
|
||||
|
||||
@ -33,8 +33,8 @@ class Taskbar;
|
||||
|
||||
class Task {
|
||||
public:
|
||||
Task(const waybar::Bar &, const Json::Value &, Taskbar *,
|
||||
struct zwlr_foreign_toplevel_handle_v1 *, struct wl_seat *);
|
||||
Task(const waybar::Bar&, const Json::Value&, Taskbar*, struct zwlr_foreign_toplevel_handle_v1*,
|
||||
struct wl_seat*);
|
||||
~Task();
|
||||
|
||||
public:
|
||||
@ -53,11 +53,11 @@ class Task {
|
||||
static uint32_t global_id;
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
const Json::Value &config_;
|
||||
Taskbar *tbar_;
|
||||
struct zwlr_foreign_toplevel_handle_v1 *handle_;
|
||||
struct wl_seat *seat_;
|
||||
const waybar::Bar& bar_;
|
||||
const Json::Value& config_;
|
||||
Taskbar* tbar_;
|
||||
struct zwlr_foreign_toplevel_handle_v1* handle_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
uint32_t id_;
|
||||
|
||||
@ -89,7 +89,7 @@ class Task {
|
||||
std::string repr() const;
|
||||
std::string state_string(bool = false) const;
|
||||
void set_minimize_hint();
|
||||
void on_button_size_allocated(Gtk::Allocation &alloc);
|
||||
void on_button_size_allocated(Gtk::Allocation& alloc);
|
||||
void hide_if_ignored();
|
||||
|
||||
public:
|
||||
@ -105,26 +105,26 @@ class Task {
|
||||
|
||||
public:
|
||||
/* Callbacks for the wlr protocol */
|
||||
void handle_title(const char *);
|
||||
void handle_app_id(const char *);
|
||||
void handle_output_enter(struct wl_output *);
|
||||
void handle_output_leave(struct wl_output *);
|
||||
void handle_state(struct wl_array *);
|
||||
void handle_title(const char*);
|
||||
void handle_app_id(const char*);
|
||||
void handle_output_enter(struct wl_output*);
|
||||
void handle_output_leave(struct wl_output*);
|
||||
void handle_state(struct wl_array*);
|
||||
void handle_done();
|
||||
void handle_closed();
|
||||
|
||||
/* Callbacks for Gtk events */
|
||||
bool handle_clicked(GdkEventButton *);
|
||||
bool handle_button_release(GdkEventButton *);
|
||||
bool handle_motion_notify(GdkEventMotion *);
|
||||
void handle_drag_data_get(const Glib::RefPtr<Gdk::DragContext> &context,
|
||||
Gtk::SelectionData &selection_data, guint info, guint time);
|
||||
void handle_drag_data_received(const Glib::RefPtr<Gdk::DragContext> &context, int x, int y,
|
||||
bool handle_clicked(GdkEventButton*);
|
||||
bool handle_button_release(GdkEventButton*);
|
||||
bool handle_motion_notify(GdkEventMotion*);
|
||||
void handle_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context,
|
||||
Gtk::SelectionData& selection_data, guint info, guint time);
|
||||
void handle_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y,
|
||||
Gtk::SelectionData selection_data, guint info, guint time);
|
||||
|
||||
public:
|
||||
bool operator==(const Task &) const;
|
||||
bool operator!=(const Task &) const;
|
||||
bool operator==(const Task&) const;
|
||||
bool operator!=(const Task&) const;
|
||||
|
||||
public:
|
||||
void update();
|
||||
@ -142,12 +142,12 @@ using TaskPtr = std::unique_ptr<Task>;
|
||||
|
||||
class Taskbar : public waybar::AModule {
|
||||
public:
|
||||
Taskbar(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
Taskbar(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Taskbar();
|
||||
void update();
|
||||
|
||||
private:
|
||||
const waybar::Bar &bar_;
|
||||
const waybar::Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
std::vector<TaskPtr> tasks_;
|
||||
|
||||
@ -155,30 +155,30 @@ class Taskbar : public waybar::AModule {
|
||||
std::unordered_set<std::string> ignore_list_;
|
||||
std::map<std::string, std::string> app_ids_replace_map_;
|
||||
|
||||
struct zwlr_foreign_toplevel_manager_v1 *manager_;
|
||||
struct wl_seat *seat_;
|
||||
struct zwlr_foreign_toplevel_manager_v1* manager_;
|
||||
struct wl_seat* seat_;
|
||||
|
||||
public:
|
||||
/* Callbacks for global registration */
|
||||
void register_manager(struct wl_registry *, uint32_t name, uint32_t version);
|
||||
void register_seat(struct wl_registry *, uint32_t name, uint32_t version);
|
||||
void register_manager(struct wl_registry*, uint32_t name, uint32_t version);
|
||||
void register_seat(struct wl_registry*, uint32_t name, uint32_t version);
|
||||
|
||||
/* Callbacks for the wlr protocol */
|
||||
void handle_toplevel_create(struct zwlr_foreign_toplevel_handle_v1 *);
|
||||
void handle_toplevel_create(struct zwlr_foreign_toplevel_handle_v1*);
|
||||
void handle_finished();
|
||||
|
||||
public:
|
||||
void add_button(Gtk::Button &);
|
||||
void move_button(Gtk::Button &, int);
|
||||
void remove_button(Gtk::Button &);
|
||||
void add_button(Gtk::Button&);
|
||||
void move_button(Gtk::Button&, int);
|
||||
void remove_button(Gtk::Button&);
|
||||
void remove_task(uint32_t);
|
||||
|
||||
bool show_output(struct wl_output *) const;
|
||||
bool show_output(struct wl_output*) const;
|
||||
bool all_outputs() const;
|
||||
|
||||
const IconLoader &icon_loader() const;
|
||||
const std::unordered_set<std::string> &ignore_list() const;
|
||||
const std::map<std::string, std::string> &app_ids_replace_map() const;
|
||||
const IconLoader& icon_loader() const;
|
||||
const std::unordered_set<std::string>& ignore_list() const;
|
||||
const std::map<std::string, std::string>& app_ids_replace_map() const;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::wlr */
|
||||
|
||||
Reference in New Issue
Block a user