Skip to content

Commit

Permalink
LibGfx: More work on header dependency reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Feb 14, 2020
1 parent d85b098 commit 08cae27
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 21 deletions.
4 changes: 3 additions & 1 deletion Libraries/LibGUI/Slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <LibGfx/StylePainter.h>
#include <AK/Assertions.h>
#include <AK/StdLibExtras.h>
#include <LibGUI/Painter.h>
#include <LibGUI/Slider.h>
#include <LibGfx/StylePainter.h>

namespace GUI {

Expand Down
5 changes: 3 additions & 2 deletions Libraries/LibGUI/TextDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
#include <AK/HashTable.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/NonnullRefPtr.h>
#include <AK/Optional.h>
#include <AK/RefCounted.h>
#include <LibCore/Timer.h>
#include <LibGfx/Color.h>
#include <LibGfx/Font.h>
#include <LibGUI/TextRange.h>
#include <LibGUI/UndoStack.h>
#include <LibGfx/Color.h>
#include <LibGfx/Font.h>

namespace GUI {

Expand Down
10 changes: 10 additions & 0 deletions Libraries/LibGfx/Color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@
*/

#include <AK/Assertions.h>
#include <AK/Optional.h>
#include <AK/String.h>
#include <LibGfx/Color.h>
#include <LibGfx/SystemTheme.h>
#include <ctype.h>
#include <stdio.h>

namespace Gfx {

Color::Color(NamedColor named)
{
struct {
Expand Down Expand Up @@ -338,3 +342,9 @@ Optional<Color> Color::from_string(const StringView& string)

return Color(r.value(), g.value(), b.value(), a.value());
}
}

inline const LogStream& operator<<(const LogStream& stream, Color value)
{
return stream << value.to_string();
}
10 changes: 3 additions & 7 deletions Libraries/LibGfx/Color.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@

#pragma once

#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/Types.h>
#include <AK/Forward.h>
#include <AK/StdLibExtras.h>

namespace Gfx {

Expand Down Expand Up @@ -274,10 +273,7 @@ class Color {
RGBA32 m_value { 0 };
};

inline const LogStream& operator<<(const LogStream& stream, Color value)
{
return stream << value.to_string();
}
const LogStream& operator<<(const LogStream&, Color);

}

Expand Down
3 changes: 3 additions & 0 deletions Libraries/LibGfx/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ class Bitmap;
class CharacterBitmap;
class Color;
class DisjointRectSet;
class Emoji;
class FloatPoint;
class FloatRect;
class FloatSize;
class Font;
class GlyphBitmap;
class ImageDecoder;
class Painter;
class Palette;
class Point;
Expand Down
10 changes: 2 additions & 8 deletions Libraries/LibGfx/Painter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

#pragma once

#include <AK/String.h>
#include <AK/Utf8View.h>
#include <AK/Forward.h>
#include <AK/Vector.h>
#include <LibGfx/Color.h>
#include <LibGfx/Forward.h>
#include <LibGfx/Point.h>
#include <LibGfx/Rect.h>
#include <LibGfx/Size.h>
Expand All @@ -38,12 +38,6 @@

namespace Gfx {

class CharacterBitmap;
class GlyphBitmap;
class Bitmap;
class Font;
class Emoji;

class Painter {
public:
explicit Painter(Gfx::Bitmap&);
Expand Down
2 changes: 2 additions & 0 deletions Libraries/LibGfx/Palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#include <AK/Forward.h>
#include <AK/Noncopyable.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <LibGfx/SystemTheme.h>

namespace GUI {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibGfx/StylePainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class StylePainter {
static void paint_surface(Painter&, const Rect&, const Palette&, bool paint_vertical_lines = true, bool paint_top_line = true);
static void paint_frame(Painter&, const Rect&, const Palette&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
static void paint_window_frame(Painter&, const Rect&, const Palette&);
static void paint_progress_bar(Painter&, const Rect&, const Palette&, int min, int max, int value, const StringView& text = {});
static void paint_progress_bar(Painter&, const Rect&, const Palette&, int min, int max, int value, const StringView& text);
static void paint_radio_button(Painter&, const Rect&, const Palette&, bool is_checked, bool is_being_pressed);
};

Expand Down
2 changes: 2 additions & 0 deletions Libraries/LibHTML/DOM/HTMLImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <LibGfx/Bitmap.h>
#include <LibGfx/ImageDecoder.h>
#include <LibHTML/CSS/StyleResolver.h>
#include <LibHTML/DOM/Document.h>
#include <LibHTML/DOM/HTMLImageElement.h>
Expand Down
3 changes: 1 addition & 2 deletions Libraries/LibHTML/DOM/HTMLImageElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#pragma once

#include <AK/ByteBuffer.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/ImageDecoder.h>
#include <LibGfx/Forward.h>
#include <LibHTML/DOM/HTMLElement.h>

class LayoutDocument;
Expand Down

0 comments on commit 08cae27

Please sign in to comment.