diff options
-rw-r--r-- | Applications/FontEditor/FontEditor.cpp | 1 | ||||
-rw-r--r-- | Demos/Fire/Fire.cpp | 3 | ||||
-rw-r--r-- | DevTools/HackStudio/EditorWrapper.cpp | 1 | ||||
-rw-r--r-- | Libraries/LibGUI/CppSyntaxHighlighter.cpp | 1 | ||||
-rw-r--r-- | Libraries/LibGUI/InputBox.cpp | 1 | ||||
-rw-r--r-- | Libraries/LibGUI/TextDocument.h | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/TextEditor.cpp | 11 | ||||
-rw-r--r-- | Libraries/LibGUI/TextEditor.h | 7 | ||||
-rw-r--r-- | Libraries/LibGUI/Widget.cpp | 1 | ||||
-rw-r--r-- | Libraries/LibGUI/Widget.h | 2 | ||||
-rw-r--r-- | Libraries/LibHTML/DOM/HTMLInputElement.cpp | 1 | ||||
-rw-r--r-- | Libraries/LibVT/TerminalWidget.h | 3 |
12 files changed, 26 insertions, 8 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp index 2d275e2b61..92e2fce624 100644 --- a/Applications/FontEditor/FontEditor.cpp +++ b/Applications/FontEditor/FontEditor.cpp @@ -36,6 +36,7 @@ #include <LibGUI/Painter.h> #include <LibGUI/SpinBox.h> #include <LibGUI/TextBox.h> +#include <LibGfx/Font.h> #include <stdlib.h> FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::Font>&& edited_font, GUI::Widget* parent) diff --git a/Demos/Fire/Fire.cpp b/Demos/Fire/Fire.cpp index 9b590c32e3..42f15bd368 100644 --- a/Demos/Fire/Fire.cpp +++ b/Demos/Fire/Fire.cpp @@ -42,12 +42,13 @@ * [ ] handle fire bitmap edges better */ -#include <LibGfx/Bitmap.h> +#include <LibCore/ElapsedTimer.h> #include <LibGUI/Application.h> #include <LibGUI/Label.h> #include <LibGUI/Painter.h> #include <LibGUI/Widget.h> #include <LibGUI/Window.h> +#include <LibGfx/Bitmap.h> #include <stdio.h> #include <stdlib.h> #include <time.h> diff --git a/DevTools/HackStudio/EditorWrapper.cpp b/DevTools/HackStudio/EditorWrapper.cpp index 6bc452ba44..9cc1a63d81 100644 --- a/DevTools/HackStudio/EditorWrapper.cpp +++ b/DevTools/HackStudio/EditorWrapper.cpp @@ -30,6 +30,7 @@ #include <LibGUI/BoxLayout.h> #include <LibGUI/InputBox.h> #include <LibGUI/Label.h> +#include <LibGfx/Font.h> extern RefPtr<EditorWrapper> g_current_editor_wrapper; diff --git a/Libraries/LibGUI/CppSyntaxHighlighter.cpp b/Libraries/LibGUI/CppSyntaxHighlighter.cpp index 931063c2d3..65deef31fb 100644 --- a/Libraries/LibGUI/CppSyntaxHighlighter.cpp +++ b/Libraries/LibGUI/CppSyntaxHighlighter.cpp @@ -1,6 +1,7 @@ #include <LibGUI/CppLexer.h> #include <LibGUI/CppSyntaxHighlighter.h> #include <LibGUI/TextEditor.h> +#include <LibGfx/Font.h> namespace GUI { diff --git a/Libraries/LibGUI/InputBox.cpp b/Libraries/LibGUI/InputBox.cpp index 7c224e1dcb..a80d7c9d8c 100644 --- a/Libraries/LibGUI/InputBox.cpp +++ b/Libraries/LibGUI/InputBox.cpp @@ -29,6 +29,7 @@ #include <LibGUI/InputBox.h> #include <LibGUI/Label.h> #include <LibGUI/TextEditor.h> +#include <LibGfx/Font.h> #include <stdio.h> namespace GUI { diff --git a/Libraries/LibGUI/TextDocument.h b/Libraries/LibGUI/TextDocument.h index 57420777e9..10416937b2 100644 --- a/Libraries/LibGUI/TextDocument.h +++ b/Libraries/LibGUI/TextDocument.h @@ -36,7 +36,7 @@ #include <LibGUI/TextRange.h> #include <LibGUI/UndoStack.h> #include <LibGfx/Color.h> -#include <LibGfx/Font.h> +#include <LibGfx/Forward.h> namespace GUI { diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp index ea106cd502..5e2daad581 100644 --- a/Libraries/LibGUI/TextEditor.cpp +++ b/Libraries/LibGUI/TextEditor.cpp @@ -38,6 +38,7 @@ #include <LibGUI/TextEditor.h> #include <LibGUI/Window.h> #include <LibGfx/Bitmap.h> +#include <LibGfx/Font.h> #include <LibGfx/Palette.h> #include <ctype.h> #include <fcntl.h> @@ -1500,4 +1501,14 @@ void TextEditor::set_syntax_highlighter(OwnPtr<SyntaxHighlighter> highlighter) } } +int TextEditor::line_height() const +{ + return font().glyph_height() + m_line_spacing; +} + +int TextEditor::glyph_width() const +{ + return font().glyph_width('x'); +} + } diff --git a/Libraries/LibGUI/TextEditor.h b/Libraries/LibGUI/TextEditor.h index be041091a1..d84c485dd1 100644 --- a/Libraries/LibGUI/TextEditor.h +++ b/Libraries/LibGUI/TextEditor.h @@ -30,11 +30,12 @@ #include <AK/HashMap.h> #include <AK/NonnullOwnPtrVector.h> #include <AK/NonnullRefPtrVector.h> +#include <LibCore/ElapsedTimer.h> #include <LibCore/Timer.h> -#include <LibGfx/TextAlignment.h> #include <LibGUI/ScrollableWidget.h> #include <LibGUI/TextDocument.h> #include <LibGUI/TextRange.h> +#include <LibGfx/TextAlignment.h> namespace GUI { @@ -89,11 +90,11 @@ public: void scroll_position_into_view(const TextPosition&); size_t line_count() const { return document().line_count(); } int line_spacing() const { return m_line_spacing; } - int line_height() const { return font().glyph_height() + m_line_spacing; } + int line_height() const; TextPosition cursor() const { return m_cursor; } TextRange normalized_selection() const { return m_selection.normalized(); } // FIXME: This should take glyph spacing into account, no? - int glyph_width() const { return font().glyph_width('x'); } + int glyph_width() const; void insert_at_cursor_or_replace_selection(const StringView&); bool write_to_file(const StringView& path); diff --git a/Libraries/LibGUI/Widget.cpp b/Libraries/LibGUI/Widget.cpp index a363a730ba..e7ab4aa14a 100644 --- a/Libraries/LibGUI/Widget.cpp +++ b/Libraries/LibGUI/Widget.cpp @@ -45,6 +45,7 @@ #include <LibGUI/Window.h> #include <LibGUI/WindowServerConnection.h> #include <LibGfx/Bitmap.h> +#include <LibGfx/Font.h> #include <LibGfx/Palette.h> #include <unistd.h> diff --git a/Libraries/LibGUI/Widget.h b/Libraries/LibGUI/Widget.h index a0e3ed13b3..536d554424 100644 --- a/Libraries/LibGUI/Widget.h +++ b/Libraries/LibGUI/Widget.h @@ -29,10 +29,8 @@ #include <AK/Badge.h> #include <AK/HashMap.h> #include <AK/String.h> -#include <LibCore/ElapsedTimer.h> #include <LibCore/Object.h> #include <LibGUI/Event.h> -#include <LibGUI/Shortcut.h> #include <LibGfx/Color.h> #include <LibGfx/Forward.h> #include <LibGfx/Orientation.h> diff --git a/Libraries/LibHTML/DOM/HTMLInputElement.cpp b/Libraries/LibHTML/DOM/HTMLInputElement.cpp index 238eb71a67..7780f08d26 100644 --- a/Libraries/LibHTML/DOM/HTMLInputElement.cpp +++ b/Libraries/LibHTML/DOM/HTMLInputElement.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <LibCore/ElapsedTimer.h> #include <LibGUI/Button.h> #include <LibGUI/TextBox.h> #include <LibHTML/DOM/Document.h> diff --git a/Libraries/LibVT/TerminalWidget.h b/Libraries/LibVT/TerminalWidget.h index a1b994dd9a..7e465828c4 100644 --- a/Libraries/LibVT/TerminalWidget.h +++ b/Libraries/LibVT/TerminalWidget.h @@ -28,11 +28,12 @@ #include <AK/String.h> #include <LibCore/ConfigFile.h> +#include <LibCore/ElapsedTimer.h> #include <LibCore/Notifier.h> #include <LibCore/Timer.h> +#include <LibGUI/Frame.h> #include <LibGfx/Bitmap.h> #include <LibGfx/Rect.h> -#include <LibGUI/Frame.h> #include <LibVT/Terminal.h> namespace GUI { |