소스 검색

LibGfx: Replace manual forward declarations with <LibGfx/Forward.h>

Andreas Kling 5 년 전
부모
커밋
a368cf7d51

+ 1 - 0
Libraries/LibCore/Forward.h

@@ -52,6 +52,7 @@ class Socket;
 class SocketAddress;
 class TCPServer;
 class TCPSocket;
+class Timer;
 class TimerEvent;
 class UdpServer;
 class UdpSocket;

+ 3 - 12
Libraries/LibGUI/Application.h

@@ -29,19 +29,10 @@
 #include <AK/Badge.h>
 #include <AK/HashMap.h>
 #include <AK/OwnPtr.h>
-#include <LibGfx/Palette.h>
+#include <LibCore/Forward.h>
 #include <LibGUI/Shortcut.h>
-
-namespace AK {
-class SharedBuffer;
-}
-namespace Core {
-class EventLoop;
-}
-namespace Gfx {
-class Palette;
-class Point;
-}
+#include <LibGfx/Forward.h>
+#include <LibGfx/Palette.h>
 
 namespace GUI {
 class Action;

+ 1 - 4
Libraries/LibGUI/DragOperation.h

@@ -28,10 +28,7 @@
 
 #include <LibCore/EventLoop.h>
 #include <LibCore/Object.h>
-
-namespace Gfx {
-class Bitmap;
-}
+#include <LibGfx/Forward.h>
 
 namespace GUI {
 

+ 1 - 4
Libraries/LibGUI/FontDatabase.h

@@ -29,10 +29,7 @@
 #include <AK/Function.h>
 #include <AK/HashMap.h>
 #include <AK/String.h>
-
-namespace Gfx {
-class Font;
-}
+#include <LibGfx/Forward.h>
 
 struct Metadata {
     String path;

+ 0 - 4
Libraries/LibGUI/Label.h

@@ -29,10 +29,6 @@
 #include <LibGfx/TextAlignment.h>
 #include <LibGUI/Frame.h>
 
-namespace Gfx {
-class Bitmap;
-}
-
 namespace GUI {
 
 class Label : public Frame {

+ 1 - 4
Libraries/LibGUI/Menu.h

@@ -31,10 +31,7 @@
 #include <AK/NonnullRefPtr.h>
 #include <LibCore/Object.h>
 #include <LibGUI/MenuItem.h>
-
-namespace Gfx {
-class Point;
-}
+#include <LibGfx/Forward.h>
 
 namespace GUI {
 

+ 2 - 5
Libraries/LibGUI/Model.h

@@ -31,13 +31,10 @@
 #include <AK/HashTable.h>
 #include <AK/RefCounted.h>
 #include <AK/String.h>
-#include <LibGfx/TextAlignment.h>
 #include <LibGUI/ModelIndex.h>
 #include <LibGUI/Variant.h>
-
-namespace Gfx {
-class Font;
-}
+#include <LibGfx/Forward.h>
+#include <LibGfx/TextAlignment.h>
 
 namespace GUI {
 

+ 0 - 4
Libraries/LibGUI/Widget.h

@@ -42,10 +42,6 @@
     extern WidgetClassRegistration registration_##class_name; \
     WidgetClassRegistration registration_##class_name(#class_name, [](Widget* parent) { return class_name::construct(parent); });
 
-namespace Gfx {
-class Bitmap;
-}
-
 namespace GUI {
 class Widget;
 }

+ 1 - 4
Libraries/LibHTML/CSS/StyleProperties.h

@@ -29,12 +29,9 @@
 #include <AK/HashMap.h>
 #include <AK/NonnullRefPtr.h>
 #include <LibGfx/Font.h>
+#include <LibGfx/Forward.h>
 #include <LibHTML/CSS/StyleValue.h>
 
-namespace Gfx {
-class Color;
-}
-
 class StyleProperties : public RefCounted<StyleProperties> {
 public:
     StyleProperties();

+ 1 - 8
Libraries/LibHTML/DOM/Document.h

@@ -32,18 +32,11 @@
 #include <AK/String.h>
 #include <AK/URL.h>
 #include <AK/WeakPtr.h>
+#include <LibCore/Forward.h>
 #include <LibHTML/CSS/StyleResolver.h>
 #include <LibHTML/CSS/StyleSheet.h>
 #include <LibHTML/DOM/ParentNode.h>
 
-namespace Core {
-class Timer;
-}
-
-namespace Gfx {
-class Palette;
-}
-
 class Frame;
 class HTMLBodyElement;
 class HTMLHtmlElement;

+ 1 - 4
Libraries/LibHTML/FontCache.h

@@ -28,10 +28,7 @@
 
 #include <AK/HashMap.h>
 #include <AK/String.h>
-
-namespace Gfx {
-class Font;
-}
+#include <LibGfx/Forward.h>
 
 struct FontSelector {
     String family;

+ 1 - 5
Servers/WindowServer/Button.h

@@ -30,11 +30,7 @@
 #include <AK/NonnullRefPtr.h>
 #include <AK/Weakable.h>
 #include <LibGfx/Rect.h>
-
-namespace Gfx {
-class CharacterBitmap;
-class Painter;
-}
+#include <LibGfx/Forward.h>
 
 namespace WindowServer {
 

+ 1 - 0
Servers/WindowServer/ClientConnection.cpp

@@ -24,6 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <AK/Badge.h>
 #include <AK/SharedBuffer.h>
 #include <LibGfx/Bitmap.h>
 #include <LibGfx/SystemTheme.h>

+ 1 - 0
Servers/WindowServer/Compositor.cpp

@@ -30,6 +30,7 @@
 #include "Screen.h"
 #include "Window.h"
 #include "WindowManager.h"
+#include <LibCore/Timer.h>
 #include <LibGfx/Font.h>
 #include <LibGfx/Painter.h>
 #include <LibThread/BackgroundAction.h>

+ 1 - 6
Servers/WindowServer/Compositor.h

@@ -29,13 +29,8 @@
 #include <AK/OwnPtr.h>
 #include <AK/RefPtr.h>
 #include <LibCore/Object.h>
-#include <LibCore/Timer.h>
-#include <LibGfx/Bitmap.h>
 #include <LibGfx/DisjointRectSet.h>
-
-namespace Gfx {
-class Painter;
-}
+#include <LibGfx/Forward.h>
 
 namespace WindowServer {
 

+ 1 - 4
Servers/WindowServer/Menu.h

@@ -30,15 +30,12 @@
 #include <AK/String.h>
 #include <AK/WeakPtr.h>
 #include <LibCore/Object.h>
+#include <LibGfx/Forward.h>
 #include <LibGfx/Rect.h>
 #include <WindowServer/Cursor.h>
 #include <WindowServer/MenuItem.h>
 #include <WindowServer/Window.h>
 
-namespace Gfx {
-class Font;
-}
-
 namespace WindowServer {
 
 class ClientConnection;

+ 1 - 4
Servers/WindowServer/MenuItem.h

@@ -28,12 +28,9 @@
 
 #include <AK/Function.h>
 #include <AK/String.h>
+#include <LibGfx/Forward.h>
 #include <LibGfx/Rect.h>
 
-namespace Gfx {
-class Bitmap;
-}
-
 namespace WindowServer {
 
 class Menu;

+ 1 - 0
Servers/WindowServer/MenuManager.cpp

@@ -25,6 +25,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <AK/Badge.h>
 #include <AK/FileSystemPath.h>
 #include <AK/QuickSort.h>
 #include <LibCore/DirIterator.h>

+ 6 - 0
Servers/WindowServer/Window.cpp

@@ -31,6 +31,7 @@
 #include "Screen.h"
 #include "WindowClientEndpoint.h"
 #include "WindowManager.h"
+#include <AK/Badge.h>
 
 namespace WindowServer {
 
@@ -414,4 +415,9 @@ void Window::set_tiled(WindowTileType tiled)
     Core::EventLoop::current().post_event(*this, make<ResizeEvent>(old_rect, m_rect));
 }
 
+void Window::detach_client(Badge<ClientConnection>)
+{
+    m_client = nullptr;
+}
+
 }

+ 1 - 1
Servers/WindowServer/Window.h

@@ -223,7 +223,7 @@ public:
     Window* m_next { nullptr };
     Window* m_prev { nullptr };
 
-    void detach_client(Badge<ClientConnection>) { m_client = nullptr; }
+    void detach_client(Badge<ClientConnection>);
 
 private:
     void handle_mouse_event(const MouseEvent&);

+ 1 - 0
Servers/WindowServer/WindowFrame.cpp

@@ -24,6 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <AK/Badge.h>
 #include <LibGfx/CharacterBitmap.h>
 #include <LibGfx/Font.h>
 #include <LibGfx/Painter.h>

+ 2 - 6
Servers/WindowServer/WindowFrame.h

@@ -26,13 +26,9 @@
 
 #pragma once
 
-#include <AK/Badge.h>
+#include <AK/Forward.h>
 #include <AK/NonnullOwnPtrVector.h>
-
-namespace Gfx {
-class Painter;
-class Rect;
-}
+#include <LibGfx/Forward.h>
 
 namespace WindowServer {
 

+ 1 - 4
Servers/WindowServer/WindowSwitcher.h

@@ -29,12 +29,9 @@
 #include <AK/Vector.h>
 #include <AK/WeakPtr.h>
 #include <LibCore/Object.h>
+#include <LibGfx/Forward.h>
 #include <LibGfx/Rect.h>
 
-namespace Gfx {
-class Painter;
-}
-
 namespace WindowServer {
 
 class KeyEvent;