LibGUI: Remove more header dependencies from Widget.h
This commit is contained in:
parent
69400c2ca1
commit
e1ff4fa034
Notes:
sideshowbarker
2024-07-19 09:19:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e1ff4fa0343
12 changed files with 26 additions and 8 deletions
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <LibGUI/CppLexer.h>
|
||||
#include <LibGUI/CppSyntaxHighlighter.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGfx/Font.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue