Browse Source

LibGUI: Remove some header dependencies from Application.h

Andreas Kling 5 years ago
parent
commit
dcb0766d3f

+ 8 - 5
Applications/SystemMonitor/main.cpp

@@ -52,6 +52,7 @@
 #include <LibGUI/ToolBar.h>
 #include <LibGUI/Widget.h>
 #include <LibGUI/Window.h>
+#include <LibGfx/Palette.h>
 #include <LibPCIDB/Database.h>
 #include <signal.h>
 #include <stdio.h>
@@ -145,11 +146,13 @@ int main(int argc, char** argv)
     toolbar->set_has_frame(false);
     auto process_table_view = ProcessTableView::construct(process_table_container);
 
-    auto refresh_timer = Core::Timer::construct(1000, [&] {
-        process_table_view->refresh();
-        if (auto* memory_stats_widget = MemoryStatsWidget::the())
-            memory_stats_widget->refresh();
-    }, window);
+    auto refresh_timer = Core::Timer::construct(
+        1000, [&] {
+            process_table_view->refresh();
+            if (auto* memory_stats_widget = MemoryStatsWidget::the())
+                memory_stats_widget->refresh();
+        },
+        window);
 
     auto kill_action = GUI::Action::create("Kill process", { Mod_Ctrl, Key_K }, Gfx::Bitmap::load_from_file("/res/icons/kill16.png"), [process_table_view](const GUI::Action&) {
         pid_t pid = process_table_view->selected_pid();

+ 1 - 0
Applications/Terminal/main.cpp

@@ -40,6 +40,7 @@
 #include <LibGUI/Widget.h>
 #include <LibGUI/Window.h>
 #include <LibGfx/Font.h>
+#include <LibGfx/Palette.h>
 #include <LibVT/TerminalWidget.h>
 #include <assert.h>
 #include <errno.h>

+ 5 - 0
Libraries/LibGUI/Application.cpp

@@ -189,4 +189,9 @@ void Application::set_palette(const Palette& palette)
     m_palette = palette.impl();
 }
 
+Gfx::Palette Application::palette() const
+{
+    return Palette(*m_palette);
+}
+
 }

+ 2 - 5
Libraries/LibGUI/Application.h

@@ -26,20 +26,17 @@
 
 #pragma once
 
-#include <AK/Badge.h>
 #include <AK/HashMap.h>
 #include <AK/OwnPtr.h>
 #include <LibCore/Forward.h>
 #include <LibGUI/Shortcut.h>
 #include <LibGfx/Forward.h>
-#include <LibGfx/Palette.h>
 
 namespace GUI {
 class Action;
 class KeyEvent;
 class MenuBar;
 class Window;
-class WindowServerConnection;
 
 class Application {
 public:
@@ -68,8 +65,8 @@ public:
     const String& invoked_as() const { return m_invoked_as; }
     const Vector<String>& args() const { return m_args; }
 
-    Palette palette() const { return Palette(*m_palette); }
-    void set_palette(const Palette&);
+    Gfx::Palette palette() const;
+    void set_palette(const Gfx::Palette&);
 
     void set_system_palette(SharedBuffer&);