diff options
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/CppSyntaxHighlighter.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/JSSyntaxHighlighter.cpp | 12 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/JsonArrayModel.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Window.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/WindowServerConnection.cpp | 20 |
5 files changed, 22 insertions, 24 deletions
diff --git a/Userland/Libraries/LibGUI/CppSyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/CppSyntaxHighlighter.cpp index 2a2572ef05..a4c6fd1205 100644 --- a/Userland/Libraries/LibGUI/CppSyntaxHighlighter.cpp +++ b/Userland/Libraries/LibGUI/CppSyntaxHighlighter.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <AK/Debug.h> #include <LibCpp/Lexer.h> #include <LibGUI/CppSyntaxHighlighter.h> #include <LibGUI/TextEditor.h> @@ -83,9 +84,7 @@ void CppSyntaxHighlighter::rehighlight(Gfx::Palette palette) Vector<GUI::TextDocumentSpan> spans; for (auto& token : tokens) { -#ifdef DEBUG_SYNTAX_HIGHLIGHTING - dbg() << token.to_string() << " @ " << token.m_start.line << ":" << token.m_start.column << " - " << token.m_end.line << ":" << token.m_end.column; -#endif + dbgln<debug_syntax_highlighting>("{} @ {}:{} - {}:{}", token.to_string(), token.m_start.line, token.m_start.column, token.m_end.line, token.m_end.column); GUI::TextDocumentSpan span; span.range.set_start({ token.m_start.line, token.m_start.column }); span.range.set_end({ token.m_end.line, token.m_end.column }); diff --git a/Userland/Libraries/LibGUI/JSSyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/JSSyntaxHighlighter.cpp index 0ceb45535b..2f70a59098 100644 --- a/Userland/Libraries/LibGUI/JSSyntaxHighlighter.cpp +++ b/Userland/Libraries/LibGUI/JSSyntaxHighlighter.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <AK/Debug.h> #include <LibGUI/JSSyntaxHighlighter.h> #include <LibGUI/TextEditor.h> #include <LibGfx/Font.h> @@ -107,11 +108,12 @@ void JSSyntaxHighlighter::rehighlight(Gfx::Palette palette) spans.append(span); advance_position(str[str.length() - 1]); -#ifdef DEBUG_SYNTAX_HIGHLIGHTING - dbg() << token.name() << (is_trivia ? " (trivia) @ \"" : " @ \"") << token.value() << "\" " - << span.range.start().line() << ":" << span.range.start().column() << " - " - << span.range.end().line() << ":" << span.range.end().column(); -#endif + dbgln<debug_syntax_highlighting>("{}{} @ '{}' {}:{} - {}:{}", + token.name(), + is_trivia ? " (trivia)" : "", + token.value(), + span.range.start().line(), span.range.start().column(), + span.range.end().line(), span.range.end().column()); }; bool was_eof = false; diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.cpp b/Userland/Libraries/LibGUI/JsonArrayModel.cpp index 31e6430200..83846ff37a 100644 --- a/Userland/Libraries/LibGUI/JsonArrayModel.cpp +++ b/Userland/Libraries/LibGUI/JsonArrayModel.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <AK/Debug.h> #include <AK/JsonObject.h> #include <LibCore/File.h> #include <LibGUI/JsonArrayModel.h> @@ -34,7 +35,7 @@ void JsonArrayModel::update() { auto file = Core::File::construct(m_json_path); if (!file->open(Core::IODevice::ReadOnly)) { - dbg() << "Unable to open " << file->filename(); + dbgln("Unable to open {}", file->filename()); m_array.clear(); did_update(); return; @@ -53,7 +54,7 @@ bool JsonArrayModel::store() { auto file = Core::File::construct(m_json_path); if (!file->open(Core::IODevice::WriteOnly)) { - dbg() << "Unable to open " << file->filename(); + dbgln("Unable to open {}", file->filename()); return false; } diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 32f16c7ffe..3e734d2e56 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -267,3 +267,7 @@ private: }; } + +template<> +struct AK::Formatter<GUI::Window> : Formatter<Core::Object> { +}; diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.cpp b/Userland/Libraries/LibGUI/WindowServerConnection.cpp index 19555cdac6..279f7a1a89 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Userland/Libraries/LibGUI/WindowServerConnection.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <AK/Debug.h> #include <AK/StringBuilder.h> #include <LibCore/EventLoop.h> #include <LibCore/MimeData.h> @@ -43,8 +44,6 @@ #include <LibGfx/Palette.h> #include <LibGfx/SystemTheme.h> -//#define KEYBOARD_SHORTCUTS_DEBUG - namespace GUI { WindowServerConnection& WindowServerConnection::the() @@ -142,32 +141,25 @@ void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& messa auto key_event = make<KeyEvent>(Event::KeyDown, (KeyCode)message.key(), message.modifiers(), message.code_point(), message.scancode()); Action* action = nullptr; -#ifdef KEYBOARD_SHORTCUTS_DEBUG - dbg() << "Looking up action for " << key_event->to_string(); -#endif + dbgln<debug_keyboard_shortcuts>("Looking up action for {}", key_event->to_string()); if (auto* focused_widget = window->focused_widget()) { for (auto* widget = focused_widget; widget && !action; widget = widget->parent_widget()) { action = widget->action_for_key_event(*key_event); -#ifdef KEYBOARD_SHORTCUTS_DEBUG - dbg() << " > Focused widget " << *widget << " gave action: " << action; -#endif + + dbgln<debug_keyboard_shortcuts>(" > Focused widget {} gave action: {}", *widget, action); } } if (!action) { action = window->action_for_key_event(*key_event); -#ifdef KEYBOARD_SHORTCUTS_DEBUG - dbg() << " > Asked window " << *window << ", got action: " << action; -#endif + dbgln<debug_keyboard_shortcuts>(" > Asked window {}, got action: {}", *window, action); } // NOTE: Application-global shortcuts are ignored while a modal window is up. if (!action && !window->is_modal()) { action = Application::the()->action_for_key_event(*key_event); -#ifdef KEYBOARD_SHORTCUTS_DEBUG - dbg() << " > Asked application, got action: " << action; -#endif + dbgln<debug_keyboard_shortcuts>(" > Asked application, got action: {}", action); } if (action) { |