internal: Formatter rework (#3186)

This commit is contained in:
Vaxry
2023-09-06 12:51:36 +02:00
committed by GitHub
parent c3a83daa1e
commit 61a71c65ac
48 changed files with 671 additions and 655 deletions

View File

@@ -140,7 +140,7 @@ static void destroyTI(wl_resource* resource) {
void CTextInputV1ProtocolManager::createTI(wl_client* client, wl_resource* resource, uint32_t id) {
const auto PTI = m_pClients.emplace_back(std::make_unique<STextInputV1>()).get();
Debug::log(LOG, "New TI V1 at %lx", PTI);
Debug::log(LOG, "New TI V1 at {:x}", (uintptr_t)PTI);
PTI->client = client;
PTI->resourceCaller = resource;

View File

@@ -149,14 +149,14 @@ void CToplevelExportProtocolManager::captureToplevel(wl_client* client, wl_resou
PFRAME->pWindow = pWindow;
if (!PFRAME->pWindow) {
Debug::log(ERR, "Client requested sharing of window handle %lx which does not exist!", PFRAME->pWindow);
Debug::log(ERR, "Client requested sharing of window handle {:x} which does not exist!", (uintptr_t)PFRAME->pWindow);
hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource);
removeFrame(PFRAME);
return;
}
if (!PFRAME->pWindow->m_bIsMapped || PFRAME->pWindow->isHidden()) {
Debug::log(ERR, "Client requested sharing of window handle %lx which is not shareable!", PFRAME->pWindow);
Debug::log(ERR, "Client requested sharing of window handle {:x} which is not shareable!", (uintptr_t)PFRAME->pWindow);
hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource);
removeFrame(PFRAME);
return;
@@ -223,7 +223,7 @@ void CToplevelExportProtocolManager::copyFrame(wl_client* client, wl_resource* r
}
if (!PFRAME->pWindow->m_bIsMapped || PFRAME->pWindow->isHidden()) {
Debug::log(ERR, "Client requested sharing of window handle %lx which is not shareable (2)!", PFRAME->pWindow);
Debug::log(ERR, "Client requested sharing of window handle {:x} which is not shareable (2)!", (uintptr_t)PFRAME->pWindow);
hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource);
removeFrame(PFRAME);
return;
@@ -406,7 +406,7 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times
// copy pixels
const auto PFORMAT = get_gles2_format_from_drm(format);
if (!PFORMAT) {
Debug::log(ERR, "[toplevel_export] Cannot read pixels, unsupported format %lx", PFORMAT);
Debug::log(ERR, "[toplevel_export] Cannot read pixels, unsupported format {:x}", (uintptr_t)PFORMAT);
g_pHyprOpenGL->end();
wlr_buffer_end_data_ptr_access(frame->buffer);
if (frame->overlayCursor)

View File

@@ -22,14 +22,14 @@ CWaylandResource::CWaylandResource(wl_client* client, const wl_interface* wlInte
m_liResourceDestroy.notify = resourceDestroyNotify;
wl_resource_add_destroy_listener(m_pWLResource, &m_liResourceDestroy);
Debug::log(TRACE, "[wl res %lx] created", m_pWLResource);
Debug::log(TRACE, "[wl res {:x}] created", (uintptr_t)m_pWLResource);
}
void CWaylandResource::markDefunct() {
if (m_bDefunct)
return;
Debug::log(TRACE, "[wl res %lx] now defunct", m_pWLResource);
Debug::log(TRACE, "[wl res {:x}] now defunct", (uintptr_t)m_pWLResource);
m_bDefunct = true;
wl_resource_set_user_data(m_pWLResource, nullptr);
}
@@ -40,7 +40,7 @@ CWaylandResource::~CWaylandResource() {
wl_list_remove(&m_liResourceDestroy.link);
wl_list_init(&m_liResourceDestroy.link);
Debug::log(TRACE, "[wl res %lx] destroying (wl_resource_destroy will be %s)", m_pWLResource, (DESTROY ? "sent" : "not sent"));
Debug::log(TRACE, "[wl res {:x}] destroying (wl_resource_destroy will be {})", (uintptr_t)m_pWLResource, (DESTROY ? "sent" : "not sent"));
if (DESTROY)
wl_resource_destroy(m_pWLResource);
@@ -62,17 +62,17 @@ uint32_t CWaylandResource::version() {
void CWaylandResource::setImplementation(const void* impl, wl_resource_destroy_func_t df) {
RASSERT(good(), "Attempted to call setImplementation() on a bad resource");
RASSERT(!m_bImplementationSet, "Wayland Resource %lx already has an implementation, cannot re-set!", m_pWLResource);
RASSERT(!m_bImplementationSet, "Wayland Resource {:x} already has an implementation, cannot re-set!", (uintptr_t)m_pWLResource);
wl_resource_set_implementation(m_pWLResource, impl, this, df);
Debug::log(TRACE, "[wl res %lx] set impl to %lx", m_pWLResource, impl);
Debug::log(TRACE, "[wl res {:x}] set impl to {:x}", (uintptr_t)m_pWLResource, (uintptr_t)impl);
m_bImplementationSet = true;
}
void CWaylandResource::setData(void* data) {
Debug::log(TRACE, "[wl res %lx] set data to %lx", m_pWLResource, data);
Debug::log(TRACE, "[wl res {:x}] set data to {:x}", (uintptr_t)m_pWLResource, (uintptr_t)data);
m_pData = data;
}
@@ -96,14 +96,14 @@ IWaylandProtocol::IWaylandProtocol(const wl_interface* iface, const int& ver, co
m_pGlobal = wl_global_create(g_pCompositor->m_sWLDisplay, iface, ver, this, &bindManagerInternal);
if (!m_pGlobal) {
Debug::log(ERR, "[proto %s] could not create a global", name.c_str());
Debug::log(ERR, "[proto {}] could not create a global", name);
return;
}
m_liDisplayDestroy.notify = displayDestroyInternal;
wl_display_add_destroy_listener(g_pCompositor->m_sWLDisplay, &m_liDisplayDestroy);
Debug::log(LOG, "[proto %s] started", name.c_str());
Debug::log(LOG, "[proto {}] started", name);
}
IWaylandProtocol::~IWaylandProtocol() {