chore: upgrade to clang-format@21
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
|
||||
namespace waybar::util::PipewireBackend {
|
||||
|
||||
static void getNodeInfo(void *data_, const struct pw_node_info *info) {
|
||||
auto *pNodeInfo = static_cast<PrivacyNodeInfo *>(data_);
|
||||
static void getNodeInfo(void* data_, const struct pw_node_info* info) {
|
||||
auto* pNodeInfo = static_cast<PrivacyNodeInfo*>(data_);
|
||||
pNodeInfo->handleNodeEventInfo(info);
|
||||
|
||||
static_cast<PipewireBackend *>(pNodeInfo->data)->privacy_nodes_changed_signal_event.emit();
|
||||
static_cast<PipewireBackend*>(pNodeInfo->data)->privacy_nodes_changed_signal_event.emit();
|
||||
}
|
||||
|
||||
static const struct pw_node_events NODE_EVENTS = {
|
||||
@@ -16,8 +16,8 @@ static const struct pw_node_events NODE_EVENTS = {
|
||||
.info = getNodeInfo,
|
||||
};
|
||||
|
||||
static void proxyDestroy(void *data) {
|
||||
static_cast<PrivacyNodeInfo *>(data)->handleProxyEventDestroy();
|
||||
static void proxyDestroy(void* data) {
|
||||
static_cast<PrivacyNodeInfo*>(data)->handleProxyEventDestroy();
|
||||
}
|
||||
|
||||
static const struct pw_proxy_events PROXY_EVENTS = {
|
||||
@@ -25,14 +25,14 @@ static const struct pw_proxy_events PROXY_EVENTS = {
|
||||
.destroy = proxyDestroy,
|
||||
};
|
||||
|
||||
static void registryEventGlobal(void *_data, uint32_t id, uint32_t permissions, const char *type,
|
||||
uint32_t version, const struct spa_dict *props) {
|
||||
static_cast<PipewireBackend *>(_data)->handleRegistryEventGlobal(id, permissions, type, version,
|
||||
props);
|
||||
static void registryEventGlobal(void* _data, uint32_t id, uint32_t permissions, const char* type,
|
||||
uint32_t version, const struct spa_dict* props) {
|
||||
static_cast<PipewireBackend*>(_data)->handleRegistryEventGlobal(id, permissions, type, version,
|
||||
props);
|
||||
}
|
||||
|
||||
static void registryEventGlobalRemove(void *_data, uint32_t id) {
|
||||
static_cast<PipewireBackend *>(_data)->handleRegistryEventGlobalRemove(id);
|
||||
static void registryEventGlobalRemove(void* _data, uint32_t id) {
|
||||
static_cast<PipewireBackend*>(_data)->handleRegistryEventGlobalRemove(id);
|
||||
}
|
||||
|
||||
static const struct pw_registry_events REGISTRY_EVENTS = {
|
||||
@@ -78,7 +78,7 @@ PipewireBackend::~PipewireBackend() {
|
||||
}
|
||||
|
||||
if (registry_ != nullptr) {
|
||||
pw_proxy_destroy((struct pw_proxy *)registry_);
|
||||
pw_proxy_destroy((struct pw_proxy*)registry_);
|
||||
}
|
||||
|
||||
spa_zero(registryListener_);
|
||||
@@ -103,11 +103,11 @@ std::shared_ptr<PipewireBackend> PipewireBackend::getInstance() {
|
||||
return std::make_shared<PipewireBackend>(tag);
|
||||
}
|
||||
|
||||
void PipewireBackend::handleRegistryEventGlobal(uint32_t id, uint32_t permissions, const char *type,
|
||||
uint32_t version, const struct spa_dict *props) {
|
||||
void PipewireBackend::handleRegistryEventGlobal(uint32_t id, uint32_t permissions, const char* type,
|
||||
uint32_t version, const struct spa_dict* props) {
|
||||
if (props == nullptr || strcmp(type, PW_TYPE_INTERFACE_Node) != 0) return;
|
||||
|
||||
const char *lookupStr = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS);
|
||||
const char* lookupStr = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS);
|
||||
if (lookupStr == nullptr) return;
|
||||
std::string mediaClass = lookupStr;
|
||||
enum PrivacyNodeType mediaType = PRIVACY_NODE_TYPE_NONE;
|
||||
@@ -121,11 +121,11 @@ void PipewireBackend::handleRegistryEventGlobal(uint32_t id, uint32_t permission
|
||||
return;
|
||||
}
|
||||
|
||||
auto *proxy = (pw_proxy *)pw_registry_bind(registry_, id, type, version, sizeof(PrivacyNodeInfo));
|
||||
auto* proxy = (pw_proxy*)pw_registry_bind(registry_, id, type, version, sizeof(PrivacyNodeInfo));
|
||||
|
||||
if (proxy == nullptr) return;
|
||||
|
||||
auto *pNodeInfo = (PrivacyNodeInfo *)pw_proxy_get_user_data(proxy);
|
||||
auto* pNodeInfo = (PrivacyNodeInfo*)pw_proxy_get_user_data(proxy);
|
||||
new (pNodeInfo) PrivacyNodeInfo{};
|
||||
pNodeInfo->id = id;
|
||||
pNodeInfo->data = this;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace waybar::util::PipewireBackend {
|
||||
|
||||
std::string PrivacyNodeInfo::getName() {
|
||||
const std::vector<std::string *> names{&application_name, &node_name};
|
||||
const std::vector<std::string*> names{&application_name, &node_name};
|
||||
std::string name = "Unknown Application";
|
||||
for (const auto &item : names) {
|
||||
for (const auto& item : names) {
|
||||
if (item != nullptr && !item->empty()) {
|
||||
name = *item;
|
||||
name[0] = toupper(name[0]);
|
||||
@@ -16,10 +16,10 @@ std::string PrivacyNodeInfo::getName() {
|
||||
}
|
||||
|
||||
std::string PrivacyNodeInfo::getIconName() {
|
||||
const std::vector<std::string *> names{&application_icon_name, &pipewire_access_portal_app_id,
|
||||
&application_name, &node_name};
|
||||
const std::vector<std::string*> names{&application_icon_name, &pipewire_access_portal_app_id,
|
||||
&application_name, &node_name};
|
||||
std::string name = "application-x-executable-symbolic";
|
||||
for (const auto &item : names) {
|
||||
for (const auto& item : names) {
|
||||
if (item != nullptr && !item->empty() && DefaultGtkIconThemeWrapper::has_icon(*item)) {
|
||||
return *item;
|
||||
}
|
||||
@@ -32,10 +32,10 @@ void PrivacyNodeInfo::handleProxyEventDestroy() {
|
||||
spa_hook_remove(&object_listener);
|
||||
}
|
||||
|
||||
void PrivacyNodeInfo::handleNodeEventInfo(const struct pw_node_info *info) {
|
||||
void PrivacyNodeInfo::handleNodeEventInfo(const struct pw_node_info* info) {
|
||||
state = info->state;
|
||||
|
||||
const struct spa_dict_item *item;
|
||||
const struct spa_dict_item* item;
|
||||
spa_dict_for_each(item, info->props) {
|
||||
if (strcmp(item->key, PW_KEY_CLIENT_ID) == 0) {
|
||||
client_id = strtoul(item->value, nullptr, 10);
|
||||
|
||||
Reference in New Issue
Block a user