HackStudio: Reduce debug spam

This commit is contained in:
Ben Wiederhake 2020-08-29 00:07:44 +02:00 committed by Andreas Kling
parent da966ac8d8
commit 04e3122526
Notes: sideshowbarker 2024-07-19 02:44:28 +09:00
2 changed files with 13 additions and 1 deletions

View file

@ -52,7 +52,7 @@ if (ALL_THE_DEBUG_MACROS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAPIC_DEBUG -DAPIC_SMP_DEBUG -DARP_DEBUG -DAWAVLOADER_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAPIC_DEBUG -DAPIC_SMP_DEBUG -DARP_DEBUG -DAWAVLOADER_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBBFS_DEBUG -DBXVGA_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBBFS_DEBUG -DBXVGA_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCACHE_DEBUG -DCHTTPJOB_DEBUG -DCNETWORKJOB_DEBUG -DCOMPOSE_DEBUG -DCONTEXT_SWITCH_DEBUG -DCONTIGUOUS_VMOBJECT_DEBUG -DCRYPTO_DEBUG -DCSOCKET_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCACHE_DEBUG -DCHTTPJOB_DEBUG -DCNETWORKJOB_DEBUG -DCOMPOSE_DEBUG -DCONTEXT_SWITCH_DEBUG -DCONTIGUOUS_VMOBJECT_DEBUG -DCRYPTO_DEBUG -DCSOCKET_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG_GZIP -DDEBUG_HIGHLIGHT_FOCUSED_FRAME -DDEBUG_IO -DDEBUG_ITEM_RECTS -DDEBUG_LOCAL_SOCKET -DDEBUG_MAPPED_FILE -DDEBUG_MARKDOWN -DDEBUG_MENUS -DDEBUG_POLL_SELECT -DDEBUG_SPAM -DDEBUG_STRINGIMPL -DDEBUG_SYNTAX_HIGHLIGHTING -DDEBUG_TEXTEDITOR -DDEFERRED_INVOKE_DEBUG -DDHCPV4CLIENT_DEBUG -DDHCPV4_DEBUG -DDOUBLECLICK_DEBUG -DDRAGDROP_DEBUG -DDWARF_DEBUG -DDYNAMIC_LOAD_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG_CURSOR_TOOL -DDEBUG_GZIP -DDEBUG_HIGHLIGHT_FOCUSED_FRAME -DDEBUG_IO -DDEBUG_ITEM_RECTS -DDEBUG_LOCAL_SOCKET -DDEBUG_MAPPED_FILE -DDEBUG_MARKDOWN -DDEBUG_MENUS -DDEBUG_POLL_SELECT -DDEBUG_SPAM -DDEBUG_STRINGIMPL -DDEBUG_SYNTAX_HIGHLIGHTING -DDEBUG_TEXTEDITOR -DDEFERRED_INVOKE_DEBUG -DDHCPV4CLIENT_DEBUG -DDHCPV4_DEBUG -DDOUBLECLICK_DEBUG -DDRAGDROP_DEBUG -DDWARF_DEBUG -DDYNAMIC_LOAD_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DE1000_DEBUG -DEBR_DEBUG -DEDITOR_DEBUG -DEMOJI_DEBUG -DETHERNET_DEBUG -DETHERNET_VERY_DEBUG -DEVENT_DEBUG -DEVENTLOOP_DEBUG -DEXEC_DEBUG -DEXT2_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DE1000_DEBUG -DEBR_DEBUG -DEDITOR_DEBUG -DEMOJI_DEBUG -DETHERNET_DEBUG -DETHERNET_VERY_DEBUG -DEVENT_DEBUG -DEVENTLOOP_DEBUG -DEXEC_DEBUG -DEXT2_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIFO_DEBUG -DFILL_PATH_DEBUG -DFORK_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIFO_DEBUG -DFILL_PATH_DEBUG -DFORK_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGBOXLAYOUT_DEBUG -DGEMINIJOB_DEBUG -DGENERATE_DEBUG_CODE -DGLOBAL_DTORS_DEBUG -DGMENU_DEBUG -DGPT_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGBOXLAYOUT_DEBUG -DGEMINIJOB_DEBUG -DGENERATE_DEBUG_CODE -DGLOBAL_DTORS_DEBUG -DGMENU_DEBUG -DGPT_DEBUG")

View file

@ -31,11 +31,15 @@
#include <AK/LogStream.h> #include <AK/LogStream.h>
#include <LibGfx/Palette.h> #include <LibGfx/Palette.h>
//#define DEBUG_CURSOR_TOOL
namespace HackStudio { namespace HackStudio {
void CursorTool::on_mousedown(GUI::MouseEvent& event) void CursorTool::on_mousedown(GUI::MouseEvent& event)
{ {
#ifdef DEBUG_CURSOR_TOOL
dbg() << "CursorTool::on_mousedown"; dbg() << "CursorTool::on_mousedown";
#endif
auto& form_widget = m_editor.form_widget(); auto& form_widget = m_editor.form_widget();
auto result = form_widget.hit_test(event.position(), GUI::Widget::ShouldRespectGreediness::No); auto result = form_widget.hit_test(event.position(), GUI::Widget::ShouldRespectGreediness::No);
@ -45,7 +49,9 @@ void CursorTool::on_mousedown(GUI::MouseEvent& event)
m_editor.selection().toggle(*result.widget); m_editor.selection().toggle(*result.widget);
} else if (!event.modifiers()) { } else if (!event.modifiers()) {
if (!m_editor.selection().contains(*result.widget)) { if (!m_editor.selection().contains(*result.widget)) {
#ifdef DEBUG_CURSOR_TOOL
dbg() << "Selection didn't contain " << *result.widget << ", making it the only selected one"; dbg() << "Selection didn't contain " << *result.widget << ", making it the only selected one";
#endif
m_editor.selection().set(*result.widget); m_editor.selection().set(*result.widget);
} }
@ -70,7 +76,9 @@ void CursorTool::on_mousedown(GUI::MouseEvent& event)
void CursorTool::on_mouseup(GUI::MouseEvent& event) void CursorTool::on_mouseup(GUI::MouseEvent& event)
{ {
#ifdef DEBUG_CURSOR_TOOL
dbg() << "CursorTool::on_mouseup"; dbg() << "CursorTool::on_mouseup";
#endif
if (event.button() == GUI::MouseButton::Left) { if (event.button() == GUI::MouseButton::Left) {
auto& form_widget = m_editor.form_widget(); auto& form_widget = m_editor.form_widget();
auto result = form_widget.hit_test(event.position(), GUI::Widget::ShouldRespectGreediness::No); auto result = form_widget.hit_test(event.position(), GUI::Widget::ShouldRespectGreediness::No);
@ -89,7 +97,9 @@ void CursorTool::on_mouseup(GUI::MouseEvent& event)
void CursorTool::on_mousemove(GUI::MouseEvent& event) void CursorTool::on_mousemove(GUI::MouseEvent& event)
{ {
#ifdef DEBUG_CURSOR_TOOL
dbg() << "CursorTool::on_mousemove"; dbg() << "CursorTool::on_mousemove";
#endif
auto& form_widget = m_editor.form_widget(); auto& form_widget = m_editor.form_widget();
if (m_rubber_banding) { if (m_rubber_banding) {
@ -126,7 +136,9 @@ void CursorTool::on_mousemove(GUI::MouseEvent& event)
void CursorTool::on_keydown(GUI::KeyEvent& event) void CursorTool::on_keydown(GUI::KeyEvent& event)
{ {
#ifdef DEBUG_CURSOR_TOOL
dbg() << "CursorTool::on_keydown"; dbg() << "CursorTool::on_keydown";
#endif
auto move_selected_widgets_by = [this](int x, int y) { auto move_selected_widgets_by = [this](int x, int y) {
m_editor.selection().for_each([&](auto& widget) { m_editor.selection().for_each([&](auto& widget) {