mirror of
https://github.com/RGBCube/serenity
synced 2025-07-30 01:37:36 +00:00
Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
This commit is contained in:
parent
1f8a633cc7
commit
09a43969ba
95 changed files with 427 additions and 425 deletions
|
@ -44,7 +44,7 @@ ParsedDHCPv4Options DHCPv4Packet::parse_options() const
|
|||
dbgln("Bogus option length {} assuming forgotten END", length);
|
||||
break;
|
||||
}
|
||||
dbgln<DHCPV4_DEBUG>("DHCP Option {} with length {}", (u8)opt_name, length);
|
||||
dbgln_if(DHCPV4_DEBUG, "DHCP Option {} with length {}", (u8)opt_name, length);
|
||||
++index;
|
||||
options.options.set(opt_name, { length, &m_options[index] });
|
||||
index += length - 1;
|
||||
|
|
|
@ -207,7 +207,7 @@ void DHCPv4Client::process_incoming(const DHCPv4Packet& packet)
|
|||
{
|
||||
auto options = packet.parse_options();
|
||||
|
||||
dbgln<DHCPV4CLIENT_DEBUG>("Here are the options: {}", options.to_string());
|
||||
dbgln_if(DHCPV4CLIENT_DEBUG, "Here are the options: {}", options.to_string());
|
||||
|
||||
auto value = options.get<DHCPMessageType>(DHCPOption::DHCPMessageType).value();
|
||||
switch (value) {
|
||||
|
|
|
@ -115,7 +115,7 @@ void Service::setup_notifier()
|
|||
|
||||
void Service::handle_socket_connection()
|
||||
{
|
||||
dbgln<SERVICE_DEBUG>("Ready to read on behalf of {}", name());
|
||||
dbgln_if(SERVICE_DEBUG, "Ready to read on behalf of {}", name());
|
||||
|
||||
if (m_accept_socket_connections) {
|
||||
int accepted_fd = accept(m_socket_fd, nullptr, nullptr);
|
||||
|
@ -144,7 +144,7 @@ void Service::activate()
|
|||
|
||||
void Service::spawn(int socket_fd)
|
||||
{
|
||||
dbgln<SERVICE_DEBUG>("Spawning {}", name());
|
||||
dbgln_if(SERVICE_DEBUG, "Spawning {}", name());
|
||||
|
||||
m_run_timer.start();
|
||||
pid_t pid = fork();
|
||||
|
|
|
@ -54,7 +54,7 @@ static void sigchld_handler(int)
|
|||
if (pid == 0)
|
||||
break;
|
||||
|
||||
dbgln<SYSTEMSERVER_DEBUG>("Reaped child with pid {}, exit status {}", pid, status);
|
||||
dbgln_if(SYSTEMSERVER_DEBUG, "Reaped child with pid {}, exit status {}", pid, status);
|
||||
|
||||
Service* service = Service::find_by_pid(pid);
|
||||
if (service == nullptr) {
|
||||
|
|
|
@ -87,7 +87,7 @@ void ClientConnection::handle(const Messages::WebContentServer::UpdateSystemThem
|
|||
|
||||
void ClientConnection::handle(const Messages::WebContentServer::LoadURL& message)
|
||||
{
|
||||
dbgln<SPAM_DEBUG>("handle: WebContentServer::LoadURL: url={}", message.url());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentServer::LoadURL: url={}", message.url());
|
||||
|
||||
String process_name;
|
||||
if (message.url().host().is_empty())
|
||||
|
@ -102,13 +102,13 @@ void ClientConnection::handle(const Messages::WebContentServer::LoadURL& message
|
|||
|
||||
void ClientConnection::handle(const Messages::WebContentServer::LoadHTML& message)
|
||||
{
|
||||
dbgln<SPAM_DEBUG>("handle: WebContentServer::LoadHTML: html={}, url={}", message.html(), message.url());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentServer::LoadHTML: html={}, url={}", message.html(), message.url());
|
||||
page().load_html(message.html(), message.url());
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::WebContentServer::SetViewportRect& message)
|
||||
{
|
||||
dbgln<SPAM_DEBUG>("handle: WebContentServer::SetViewportRect: rect={}", message.rect());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentServer::SetViewportRect: rect={}", message.rect());
|
||||
m_page_host->set_viewport_rect(message.rect());
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ void Compositor::compose()
|
|||
};
|
||||
|
||||
auto prepare_rect = [&](const Gfx::IntRect& rect) {
|
||||
dbgln<COMPOSE_DEBUG>(" -> flush opaque: {}", rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " -> flush opaque: {}", rect);
|
||||
ASSERT(!flush_rects.intersects(rect));
|
||||
ASSERT(!flush_transparent_rects.intersects(rect));
|
||||
flush_rects.add(rect);
|
||||
|
@ -223,7 +223,7 @@ void Compositor::compose()
|
|||
};
|
||||
|
||||
auto prepare_transparency_rect = [&](const Gfx::IntRect& rect) {
|
||||
dbgln<COMPOSE_DEBUG>(" -> flush transparent: {}", rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " -> flush transparent: {}", rect);
|
||||
ASSERT(!flush_rects.intersects(rect));
|
||||
bool have_rect = false;
|
||||
for (auto& r : flush_transparent_rects.rects()) {
|
||||
|
@ -270,7 +270,7 @@ void Compositor::compose()
|
|||
};
|
||||
|
||||
m_opaque_wallpaper_rects.for_each_intersected(dirty_screen_rects, [&](const Gfx::IntRect& render_rect) {
|
||||
dbgln<COMPOSE_DEBUG>(" render wallpaper opaque: {}", render_rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " render wallpaper opaque: {}", render_rect);
|
||||
prepare_rect(render_rect);
|
||||
paint_wallpaper(back_painter, render_rect);
|
||||
return IterationDecision::Continue;
|
||||
|
@ -282,7 +282,7 @@ void Compositor::compose()
|
|||
return IterationDecision::Continue;
|
||||
auto frame_rects = frame_rect.shatter(window.rect());
|
||||
|
||||
dbgln<COMPOSE_DEBUG>(" window {} frame rect: {}", window.title(), frame_rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " window {} frame rect: {}", window.title(), frame_rect);
|
||||
|
||||
RefPtr<Gfx::Bitmap> backing_store = window.backing_store();
|
||||
auto compose_window_rect = [&](Gfx::Painter& painter, const Gfx::IntRect& rect) {
|
||||
|
@ -291,7 +291,7 @@ void Compositor::compose()
|
|||
// TODO: Should optimize this to use a backing buffer
|
||||
Gfx::PainterStateSaver saver(painter);
|
||||
painter.add_clip_rect(intersected_rect);
|
||||
dbgln<COMPOSE_DEBUG>(" render frame: {}", intersected_rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " render frame: {}", intersected_rect);
|
||||
window.frame().paint(painter);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -373,7 +373,7 @@ void Compositor::compose()
|
|||
auto& opaque_rects = window.opaque_rects();
|
||||
if (!opaque_rects.is_empty()) {
|
||||
opaque_rects.for_each_intersected(dirty_rects, [&](const Gfx::IntRect& render_rect) {
|
||||
dbgln<COMPOSE_DEBUG>(" render opaque: {}", render_rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " render opaque: {}", render_rect);
|
||||
|
||||
prepare_rect(render_rect);
|
||||
Gfx::PainterStateSaver saver(back_painter);
|
||||
|
@ -388,7 +388,7 @@ void Compositor::compose()
|
|||
auto& transparency_wallpaper_rects = window.transparency_wallpaper_rects();
|
||||
if (!transparency_wallpaper_rects.is_empty()) {
|
||||
transparency_wallpaper_rects.for_each_intersected(dirty_rects, [&](const Gfx::IntRect& render_rect) {
|
||||
dbgln<COMPOSE_DEBUG>(" render wallpaper: {}", render_rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " render wallpaper: {}", render_rect);
|
||||
|
||||
prepare_transparency_rect(render_rect);
|
||||
paint_wallpaper(temp_painter, render_rect);
|
||||
|
@ -398,7 +398,7 @@ void Compositor::compose()
|
|||
auto& transparency_rects = window.transparency_rects();
|
||||
if (!transparency_rects.is_empty()) {
|
||||
transparency_rects.for_each_intersected(dirty_rects, [&](const Gfx::IntRect& render_rect) {
|
||||
dbgln<COMPOSE_DEBUG>(" render transparent: {}", render_rect);
|
||||
dbgln_if(COMPOSE_DEBUG, " render transparent: {}", render_rect);
|
||||
|
||||
prepare_transparency_rect(render_rect);
|
||||
Gfx::PainterStateSaver saver(temp_painter);
|
||||
|
@ -671,7 +671,7 @@ void Compositor::run_animations(Gfx::DisjointRectSet& flush_rects)
|
|||
from_rect.height() - (int)(height_delta_per_step * animation_index)
|
||||
};
|
||||
|
||||
dbgln<MINIMIZE_ANIMATION_DEBUG>("Minimize animation from {} to {} frame# {} {}", from_rect, to_rect, animation_index, rect);
|
||||
dbgln_if(MINIMIZE_ANIMATION_DEBUG, "Minimize animation from {} to {} frame# {} {}", from_rect, to_rect, animation_index, rect);
|
||||
|
||||
painter.draw_rect(rect, Color::Transparent); // Color doesn't matter, we draw inverted
|
||||
flush_rects.add(rect);
|
||||
|
|
|
@ -466,7 +466,7 @@ void MenuManager::set_current_menubar(MenuBar* menubar)
|
|||
else
|
||||
m_current_menubar = nullptr;
|
||||
|
||||
dbgln<MENUS_DEBUG>("[WM] Current menubar is now {}", menubar);
|
||||
dbgln_if(MENUS_DEBUG, "[WM] Current menubar is now {}", menubar);
|
||||
|
||||
Gfx::IntPoint next_menu_location { MenuManager::menubar_menu_margin() / 2, 0 };
|
||||
for_each_active_menubar_menu([&](Menu& menu) {
|
||||
|
|
|
@ -82,7 +82,7 @@ bool Screen::set_resolution(int width, int height, int new_scale_factor)
|
|||
|
||||
FBResolution physical_resolution { 0, (unsigned)new_physical_width, (unsigned)new_physical_height };
|
||||
int rc = fb_set_resolution(m_framebuffer_fd, &physical_resolution);
|
||||
dbgln<WSSCREEN_DEBUG>("fb_set_resolution() - return code {}", rc);
|
||||
dbgln_if(WSSCREEN_DEBUG, "fb_set_resolution() - return code {}", rc);
|
||||
|
||||
if (rc == 0) {
|
||||
on_change_resolution(physical_resolution.pitch, physical_resolution.width, physical_resolution.height, new_scale_factor);
|
||||
|
|
|
@ -343,7 +343,7 @@ void WindowManager::notify_title_changed(Window& window)
|
|||
if (window.type() != WindowType::Normal)
|
||||
return;
|
||||
|
||||
dbgln<WINDOWMANAGER_DEBUG>("[WM] Window({}) title set to '{}'", &window, window.title());
|
||||
dbgln_if(WINDOWMANAGER_DEBUG, "[WM] Window({}) title set to '{}'", &window, window.title());
|
||||
|
||||
if (m_switcher.is_visible())
|
||||
m_switcher.refresh();
|
||||
|
@ -356,7 +356,7 @@ void WindowManager::notify_modal_unparented(Window& window)
|
|||
if (window.type() != WindowType::Normal)
|
||||
return;
|
||||
|
||||
dbgln<WINDOWMANAGER_DEBUG>("[WM] Window({}) was unparented", &window);
|
||||
dbgln_if(WINDOWMANAGER_DEBUG, "[WM] Window({}) was unparented", &window);
|
||||
|
||||
if (m_switcher.is_visible())
|
||||
m_switcher.refresh();
|
||||
|
@ -366,7 +366,7 @@ void WindowManager::notify_modal_unparented(Window& window)
|
|||
|
||||
void WindowManager::notify_rect_changed(Window& window, const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect)
|
||||
{
|
||||
dbgln<RESIZE_DEBUG>("[WM] Window({}) rect changed {} -> {}", &window, old_rect, new_rect);
|
||||
dbgln_if(RESIZE_DEBUG, "[WM] Window({}) rect changed {} -> {}", &window, old_rect, new_rect);
|
||||
|
||||
if (m_switcher.is_visible() && window.type() != WindowType::WindowSwitcher)
|
||||
m_switcher.refresh();
|
||||
|
@ -431,7 +431,7 @@ bool WindowManager::pick_new_active_window(Window* previous_active)
|
|||
|
||||
void WindowManager::start_window_move(Window& window, const MouseEvent& event)
|
||||
{
|
||||
dbgln<MOVE_DEBUG>("[WM] Begin moving Window({})", &window);
|
||||
dbgln_if(MOVE_DEBUG, "[WM] Begin moving Window({})", &window);
|
||||
|
||||
move_to_front_and_make_active(window);
|
||||
m_move_window = window;
|
||||
|
@ -464,7 +464,7 @@ void WindowManager::start_window_resize(Window& window, const Gfx::IntPoint& pos
|
|||
return;
|
||||
}
|
||||
|
||||
dbgln<RESIZE_DEBUG>("[WM] Begin resizing Window({})", &window);
|
||||
dbgln_if(RESIZE_DEBUG, "[WM] Begin resizing Window({})", &window);
|
||||
|
||||
m_resizing_mouse_button = button;
|
||||
m_resize_window = window;
|
||||
|
@ -491,7 +491,7 @@ bool WindowManager::process_ongoing_window_move(MouseEvent& event, Window*& hove
|
|||
return false;
|
||||
if (event.type() == Event::MouseUp && event.button() == MouseButton::Left) {
|
||||
|
||||
dbgln<MOVE_DEBUG>("[WM] Finish moving Window({})", m_move_window);
|
||||
dbgln_if(MOVE_DEBUG, "[WM] Finish moving Window({})", m_move_window);
|
||||
|
||||
m_move_window->invalidate();
|
||||
if (m_move_window->rect().contains(event.position()))
|
||||
|
@ -577,7 +577,7 @@ bool WindowManager::process_ongoing_window_resize(const MouseEvent& event, Windo
|
|||
return false;
|
||||
|
||||
if (event.type() == Event::MouseUp && event.button() == m_resizing_mouse_button) {
|
||||
dbgln<RESIZE_DEBUG>("[WM] Finish resizing Window({})", m_resize_window);
|
||||
dbgln_if(RESIZE_DEBUG, "[WM] Finish resizing Window({})", m_resize_window);
|
||||
|
||||
Core::EventLoop::current().post_event(*m_resize_window, make<ResizeEvent>(m_resize_window->rect()));
|
||||
m_resize_window->invalidate();
|
||||
|
@ -684,7 +684,7 @@ bool WindowManager::process_ongoing_window_resize(const MouseEvent& event, Windo
|
|||
if (m_resize_window->rect() == new_rect)
|
||||
return true;
|
||||
|
||||
dbgln<RESIZE_DEBUG>("[WM] Resizing, original: {}, now: {}", m_resize_window_original_rect, new_rect);
|
||||
dbgln_if(RESIZE_DEBUG, "[WM] Resizing, original: {}, now: {}", m_resize_window_original_rect, new_rect);
|
||||
|
||||
m_resize_window->set_rect(new_rect);
|
||||
Core::EventLoop::current().post_event(*m_resize_window, make<ResizeEvent>(new_rect));
|
||||
|
@ -806,7 +806,7 @@ void WindowManager::start_menu_doubleclick(Window& window, const MouseEvent& eve
|
|||
// we either haven't clicked anywhere, or we haven't clicked on this
|
||||
// window. set the current click window, and reset the timers.
|
||||
|
||||
dbgln<DOUBLECLICK_DEBUG>("Initial mousedown on Window({}) for menus (previous was {})", &window, m_double_click_info.m_clicked_window);
|
||||
dbgln_if(DOUBLECLICK_DEBUG, "Initial mousedown on Window({}) for menus (previous was {})", &window, m_double_click_info.m_clicked_window);
|
||||
|
||||
m_double_click_info.m_clicked_window = window;
|
||||
m_double_click_info.reset();
|
||||
|
@ -838,7 +838,7 @@ void WindowManager::process_event_for_doubleclick(Window& window, MouseEvent& ev
|
|||
if (&window != m_double_click_info.m_clicked_window) {
|
||||
// we either haven't clicked anywhere, or we haven't clicked on this
|
||||
// window. set the current click window, and reset the timers.
|
||||
dbgln<DOUBLECLICK_DEBUG>("Initial mouseup on Window({}) for menus (previous was {})", &window, m_double_click_info.m_clicked_window);
|
||||
dbgln_if(DOUBLECLICK_DEBUG, "Initial mouseup on Window({}) for menus (previous was {})", &window, m_double_click_info.m_clicked_window);
|
||||
|
||||
m_double_click_info.m_clicked_window = window;
|
||||
m_double_click_info.reset();
|
||||
|
@ -853,7 +853,7 @@ void WindowManager::process_event_for_doubleclick(Window& window, MouseEvent& ev
|
|||
// clock
|
||||
metadata.clock.start();
|
||||
} else {
|
||||
dbgln<DOUBLECLICK_DEBUG>("Transforming MouseUp to MouseDoubleClick ({} < {})!", metadata.clock.elapsed(), m_double_click_speed);
|
||||
dbgln_if(DOUBLECLICK_DEBUG, "Transforming MouseUp to MouseDoubleClick ({} < {})!", metadata.clock.elapsed(), m_double_click_speed);
|
||||
|
||||
event = MouseEvent(Event::MouseDoubleClick, event.position(), event.buttons(), event.button(), event.modifiers(), event.wheel_delta());
|
||||
// invalidate this now we've delivered a doubleclick, otherwise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue