Skip to content

Commit

Permalink
LibGfx: Replace manual forward declarations with <LibGfx/Forward.h>
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Feb 14, 2020
1 parent 34c7322 commit a368cf7
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 83 deletions.
1 change: 1 addition & 0 deletions Libraries/LibCore/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Socket;
class SocketAddress;
class TCPServer;
class TCPSocket;
class Timer;
class TimerEvent;
class UdpServer;
class UdpSocket;
Expand Down
15 changes: 3 additions & 12 deletions Libraries/LibGUI/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions Libraries/LibGUI/DragOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@

#include <LibCore/EventLoop.h>
#include <LibCore/Object.h>

namespace Gfx {
class Bitmap;
}
#include <LibGfx/Forward.h>

namespace GUI {

Expand Down
5 changes: 1 addition & 4 deletions Libraries/LibGUI/FontDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions Libraries/LibGUI/Label.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
#include <LibGfx/TextAlignment.h>
#include <LibGUI/Frame.h>

namespace Gfx {
class Bitmap;
}

namespace GUI {

class Label : public Frame {
Expand Down
5 changes: 1 addition & 4 deletions Libraries/LibGUI/Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
7 changes: 2 additions & 5 deletions Libraries/LibGUI/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 0 additions & 4 deletions Libraries/LibGUI/Widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions Libraries/LibHTML/CSS/StyleProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 1 addition & 8 deletions Libraries/LibHTML/DOM/Document.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions Libraries/LibHTML/FontCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@

#include <AK/HashMap.h>
#include <AK/String.h>

namespace Gfx {
class Font;
}
#include <LibGfx/Forward.h>

struct FontSelector {
String family;
Expand Down
6 changes: 1 addition & 5 deletions Servers/WindowServer/Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
1 change: 1 addition & 0 deletions Servers/WindowServer/ClientConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions Servers/WindowServer/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 1 addition & 6 deletions Servers/WindowServer/Compositor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
5 changes: 1 addition & 4 deletions Servers/WindowServer/Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions Servers/WindowServer/MenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Servers/WindowServer/MenuManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions Servers/WindowServer/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "Screen.h"
#include "WindowClientEndpoint.h"
#include "WindowManager.h"
#include <AK/Badge.h>

namespace WindowServer {

Expand Down Expand Up @@ -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;
}

}
2 changes: 1 addition & 1 deletion Servers/WindowServer/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class Window final : public Core::Object
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&);
Expand Down
1 change: 1 addition & 0 deletions Servers/WindowServer/WindowFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 2 additions & 6 deletions Servers/WindowServer/WindowFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
5 changes: 1 addition & 4 deletions Servers/WindowServer/WindowSwitcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a368cf7

Please sign in to comment.