mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:42:44 +00:00 
			
		
		
		
	LibGUI: Add forwarding header
This patch adds <LibGUI/Forward.h> and uses it a bunch. It also dragged various header dependency reduction changes into it.
This commit is contained in:
		
							parent
							
								
									2e6ab58117
								
							
						
					
					
						commit
						2143da6434
					
				
					 115 changed files with 220 additions and 338 deletions
				
			
		|  | @ -28,11 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| class Document; | class Document; | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TableView; |  | ||||||
| class TreeView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class InspectorWidget final : public GUI::Widget { | class InspectorWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(InspectorWidget) |     C_OBJECT(InspectorWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -31,12 +31,6 @@ | ||||||
| #include <AK/Vector.h> | #include <AK/Vector.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Button; |  | ||||||
| class Label; |  | ||||||
| class TextBox; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class CalculatorWidget final : public GUI::Widget { | class CalculatorWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(CalculatorWidget) |     C_OBJECT(CalculatorWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -34,10 +34,6 @@ | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class StatusBar; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class HexEditor; | class HexEditor; | ||||||
| 
 | 
 | ||||||
| class HexEditorWidget final : public GUI::Widget { | class HexEditorWidget final : public GUI::Widget { | ||||||
|  |  | ||||||
|  | @ -31,11 +31,6 @@ | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class StackWidget; |  | ||||||
| class TableView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class IRCAppWindow : public GUI::Window { | class IRCAppWindow : public GUI::Window { | ||||||
| public: | public: | ||||||
|     IRCAppWindow(); |     IRCAppWindow(); | ||||||
|  |  | ||||||
|  | @ -28,10 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TextEditor; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class IRCChannel; | class IRCChannel; | ||||||
| class IRCClient; | class IRCClient; | ||||||
| class IRCQuery; | class IRCQuery; | ||||||
|  |  | ||||||
|  | @ -30,11 +30,6 @@ | ||||||
| #include <LibGfx/Point.h> | #include <LibGfx/Point.h> | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Menu; |  | ||||||
| class Painter; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class EllipseTool final : public Tool { | class EllipseTool final : public Tool { | ||||||
| public: | public: | ||||||
|     EllipseTool(); |     EllipseTool(); | ||||||
|  |  | ||||||
|  | @ -30,10 +30,6 @@ | ||||||
| #include <LibGfx/Point.h> | #include <LibGfx/Point.h> | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Menu; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class EraseTool final : public Tool { | class EraseTool final : public Tool { | ||||||
| public: | public: | ||||||
|     EraseTool(); |     EraseTool(); | ||||||
|  |  | ||||||
|  | @ -30,10 +30,6 @@ | ||||||
| #include <LibGfx/Point.h> | #include <LibGfx/Point.h> | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Menu; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class LineTool final : public Tool { | class LineTool final : public Tool { | ||||||
| public: | public: | ||||||
|     LineTool(); |     LineTool(); | ||||||
|  |  | ||||||
|  | @ -30,10 +30,6 @@ | ||||||
| #include <LibGfx/Point.h> | #include <LibGfx/Point.h> | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Menu; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class PenTool final : public Tool { | class PenTool final : public Tool { | ||||||
| public: | public: | ||||||
|     PenTool(); |     PenTool(); | ||||||
|  |  | ||||||
|  | @ -29,11 +29,6 @@ | ||||||
| #include "Tool.h" | #include "Tool.h" | ||||||
| #include <LibGfx/Point.h> | #include <LibGfx/Point.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Menu; |  | ||||||
| class Painter; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class RectangleTool final : public Tool { | class RectangleTool final : public Tool { | ||||||
| public: | public: | ||||||
|     RectangleTool(); |     RectangleTool(); | ||||||
|  |  | ||||||
|  | @ -31,10 +31,6 @@ | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Menu; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class SprayTool final : public Tool { | class SprayTool final : public Tool { | ||||||
| public: | public: | ||||||
|     SprayTool(); |     SprayTool(); | ||||||
|  |  | ||||||
|  | @ -36,6 +36,7 @@ | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/MenuBar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  | #include <LibGfx/Bitmap.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | int main(int argc, char** argv) | ||||||
|  |  | ||||||
|  | @ -29,11 +29,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Frame.h> | #include <LibGUI/Frame.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Label; |  | ||||||
| class Slider; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class AudioEngine; | class AudioEngine; | ||||||
| class MainWidget; | class MainWidget; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -37,10 +37,6 @@ class SamplerWidget; | ||||||
| class KeysWidget; | class KeysWidget; | ||||||
| class KnobsWidget; | class KnobsWidget; | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TabWidget; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class MainWidget final : public GUI::Widget { | class MainWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(MainWidget) |     C_OBJECT(MainWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -28,11 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Frame.h> | #include <LibGUI/Frame.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Label; |  | ||||||
| class Button; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class AudioEngine; | class AudioEngine; | ||||||
| 
 | 
 | ||||||
| class WaveEditor final : public GUI::Frame { | class WaveEditor final : public GUI::Frame { | ||||||
|  |  | ||||||
|  | @ -29,6 +29,7 @@ | ||||||
| #include "MainWidget.h" | #include "MainWidget.h" | ||||||
| #include <LibAudio/ClientConnection.h> | #include <LibAudio/ClientConnection.h> | ||||||
| #include <LibAudio/WavWriter.h> | #include <LibAudio/WavWriter.h> | ||||||
|  | #include <LibCore/EventLoop.h> | ||||||
| #include <LibCore/File.h> | #include <LibCore/File.h> | ||||||
| #include <LibGUI/AboutDialog.h> | #include <LibGUI/AboutDialog.h> | ||||||
| #include <LibGUI/Action.h> | #include <LibGUI/Action.h> | ||||||
|  | @ -38,6 +39,7 @@ | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/MenuBar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  | #include <LibGfx/Bitmap.h> | ||||||
| #include <LibThread/Thread.h> | #include <LibThread/Thread.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | int main(int argc, char** argv) | ||||||
|  |  | ||||||
|  | @ -28,10 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Label; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class GraphWidget; | class GraphWidget; | ||||||
| 
 | 
 | ||||||
| class MemoryStatsWidget final : public GUI::Widget { | class MemoryStatsWidget final : public GUI::Widget { | ||||||
|  |  | ||||||
|  | @ -29,10 +29,6 @@ | ||||||
| #include <LibCore/Timer.h> | #include <LibCore/Timer.h> | ||||||
| #include <LibGUI/LazyWidget.h> | #include <LibGUI/LazyWidget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TableView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class NetworkStatisticsWidget final : public GUI::LazyWidget { | class NetworkStatisticsWidget final : public GUI::LazyWidget { | ||||||
|     C_OBJECT(NetworkStatisticsWidget) |     C_OBJECT(NetworkStatisticsWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -28,10 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TableView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class ProcessFileDescriptorMapWidget final : public GUI::Widget { | class ProcessFileDescriptorMapWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(ProcessFileDescriptorMapWidget); |     C_OBJECT(ProcessFileDescriptorMapWidget); | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -28,11 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class JsonArrayModel; |  | ||||||
| class TableView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class ProcessMemoryMapWidget final : public GUI::Widget { | class ProcessMemoryMapWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(ProcessMemoryMapWidget); |     C_OBJECT(ProcessMemoryMapWidget); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -28,10 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TableView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class ProcessUnveiledPathsWidget final : public GUI::Widget { | class ProcessUnveiledPathsWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(ProcessUnveiledPathsWidget); |     C_OBJECT(ProcessUnveiledPathsWidget); | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -44,6 +44,7 @@ | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/ToolBar.h> | ||||||
|  | #include <LibGfx/Font.h> | ||||||
| 
 | 
 | ||||||
| TextEditorWidget::TextEditorWidget() | TextEditorWidget::TextEditorWidget() | ||||||
| { | { | ||||||
|  | @ -466,7 +467,7 @@ void TextEditorWidget::drop_event(GUI::DropEvent& event) | ||||||
| 
 | 
 | ||||||
|     if (event.mime_data().has_urls()) { |     if (event.mime_data().has_urls()) { | ||||||
|         auto urls = event.mime_data().urls(); |         auto urls = event.mime_data().urls(); | ||||||
|         if (urls.is_empty() ) |         if (urls.is_empty()) | ||||||
|             return; |             return; | ||||||
|         if (urls.size() > 1) { |         if (urls.size() > 1) { | ||||||
|             GUI::MessageBox::show("TextEditor can only open one file at a time!", "One at a time please!", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window()); |             GUI::MessageBox::show("TextEditor can only open one file at a time!", "One at a time please!", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window()); | ||||||
|  |  | ||||||
|  | @ -33,13 +33,6 @@ | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Button; |  | ||||||
| class StatusBar; |  | ||||||
| class TextBox; |  | ||||||
| class TextEditor; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class TextEditorWidget final : public GUI::Widget { | class TextEditorWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(TextEditorWidget) |     C_OBJECT(TextEditorWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -25,6 +25,7 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "TextWidget.h" | #include "TextWidget.h" | ||||||
|  | #include <AK/Optional.h> | ||||||
| #include <AK/String.h> | #include <AK/String.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <AK/Vector.h> | #include <AK/Vector.h> | ||||||
|  |  | ||||||
|  | @ -28,12 +28,9 @@ | ||||||
| 
 | 
 | ||||||
| #include "Tool.h" | #include "Tool.h" | ||||||
| #include <AK/HashMap.h> | #include <AK/HashMap.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGfx/Point.h> | #include <LibGfx/Point.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Widget; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class CursorTool final : public Tool { | class CursorTool final : public Tool { | ||||||
| public: | public: | ||||||
|     explicit CursorTool(FormEditorWidget& editor) |     explicit CursorTool(FormEditorWidget& editor) | ||||||
|  |  | ||||||
|  | @ -28,10 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Label; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class Editor; | class Editor; | ||||||
| 
 | 
 | ||||||
| class EditorWrapper : public GUI::Widget { | class EditorWrapper : public GUI::Widget { | ||||||
|  |  | ||||||
|  | @ -28,12 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Button; |  | ||||||
| class TableView; |  | ||||||
| class TextBox; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class FindInFilesWidget final : public GUI::Widget { | class FindInFilesWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(FindInFilesWidget) |     C_OBJECT(FindInFilesWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -26,6 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
|  | #include <AK/HashTable.h> | ||||||
| #include <LibGUI/ScrollableWidget.h> | #include <LibGUI/ScrollableWidget.h> | ||||||
| 
 | 
 | ||||||
| class FormWidget; | class FormWidget; | ||||||
|  |  | ||||||
|  | @ -28,11 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class ModelIndex; |  | ||||||
| class TableView; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class LocatorTextBox; | class LocatorTextBox; | ||||||
| 
 | 
 | ||||||
| class Locator final : public GUI::Widget { | class Locator final : public GUI::Widget { | ||||||
|  |  | ||||||
|  | @ -28,10 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Label; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class ProcessStateWidget final : public GUI::Widget { | class ProcessStateWidget final : public GUI::Widget { | ||||||
|     C_OBJECT(ProcessStateWidget) |     C_OBJECT(ProcessStateWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -28,6 +28,11 @@ | ||||||
| #include <LibCore/File.h> | #include <LibCore/File.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
| 
 | 
 | ||||||
|  | ProjectFile::ProjectFile(const String& name) | ||||||
|  |     : m_name(name) | ||||||
|  | { | ||||||
|  | } | ||||||
|  | 
 | ||||||
| const GUI::TextDocument& ProjectFile::document() const | const GUI::TextDocument& ProjectFile::document() const | ||||||
| { | { | ||||||
|     if (!m_document) { |     if (!m_document) { | ||||||
|  |  | ||||||
|  | @ -44,10 +44,7 @@ public: | ||||||
|     const GUI::TextDocument& document() const; |     const GUI::TextDocument& document() const; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     explicit ProjectFile(const String& name) |     explicit ProjectFile(const String& name); | ||||||
|         : m_name(name) |  | ||||||
|     { |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     String m_name; |     String m_name; | ||||||
|     mutable RefPtr<GUI::TextDocument> m_document; |     mutable RefPtr<GUI::TextDocument> m_document; | ||||||
|  |  | ||||||
|  | @ -27,16 +27,10 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Noncopyable.h> | #include <AK/Noncopyable.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| class FormEditorWidget; | class FormEditorWidget; | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class KeyEvent; |  | ||||||
| class MouseEvent; |  | ||||||
| class PaintEvent; |  | ||||||
| class Painter; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class Tool { | class Tool { | ||||||
|     AK_MAKE_NONCOPYABLE(Tool) |     AK_MAKE_NONCOPYABLE(Tool) | ||||||
|     AK_MAKE_NONMOVABLE(Tool) |     AK_MAKE_NONMOVABLE(Tool) | ||||||
|  |  | ||||||
|  | @ -31,10 +31,7 @@ | ||||||
| #include <AK/JsonValue.h> | #include <AK/JsonValue.h> | ||||||
| #include <AK/NonnullRefPtrVector.h> | #include <AK/NonnullRefPtrVector.h> | ||||||
| #include <AK/OwnPtr.h> | #include <AK/OwnPtr.h> | ||||||
| 
 | #include <LibGUI/Forward.h> | ||||||
| namespace GUI { |  | ||||||
| class Model; |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| class ProfileModel; | class ProfileModel; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -31,6 +31,7 @@ | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/MenuBar.h> | ||||||
|  | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/TreeView.h> | #include <LibGUI/TreeView.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
|  |  | ||||||
|  | @ -28,11 +28,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class TableView; |  | ||||||
| class TextBox; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class VBPropertiesWindow final : public GUI::Window { | class VBPropertiesWindow final : public GUI::Window { | ||||||
|     C_OBJECT(VBPropertiesWindow) |     C_OBJECT(VBPropertiesWindow) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -28,12 +28,9 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <AK/String.h> | #include <AK/String.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGUI/Variant.h> | #include <LibGUI/Variant.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Widget; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class VBWidget; | class VBWidget; | ||||||
| 
 | 
 | ||||||
| class VBProperty { | class VBProperty { | ||||||
|  |  | ||||||
|  | @ -36,11 +36,6 @@ | ||||||
| #include <LibGfx/Rect.h> | #include <LibGfx/Rect.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Painter; |  | ||||||
| class Variant; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class VBForm; | class VBForm; | ||||||
| class VBProperty; | class VBProperty; | ||||||
| class VBWidgetPropertyModel; | class VBWidgetPropertyModel; | ||||||
|  |  | ||||||
|  | @ -30,11 +30,6 @@ | ||||||
| #include <LibCore/Timer.h> | #include <LibCore/Timer.h> | ||||||
| #include <LibGUI/Frame.h> | #include <LibGUI/Frame.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { |  | ||||||
| class Button; |  | ||||||
| class Label; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| class Field; | class Field; | ||||||
| class SquareButton; | class SquareButton; | ||||||
| class SquareLabel; | class SquareLabel; | ||||||
|  |  | ||||||
|  | @ -24,9 +24,10 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <LibGfx/Palette.h> | #include <LibCore/Timer.h> | ||||||
| #include <LibGUI/AbstractButton.h> | #include <LibGUI/AbstractButton.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
|  | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,14 +26,10 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <LibCore/Timer.h> |  | ||||||
| #include <LibGfx/TextAlignment.h> |  | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Painter; |  | ||||||
| 
 |  | ||||||
| class AbstractButton : public Widget { | class AbstractButton : public Widget { | ||||||
|     C_OBJECT_ABSTRACT(GAbstractButton) |     C_OBJECT_ABSTRACT(GAbstractButton) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -25,9 +25,11 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
|  | #include <AK/Vector.h> | ||||||
| #include <LibGUI/AbstractTableView.h> | #include <LibGUI/AbstractTableView.h> | ||||||
| #include <LibGUI/Action.h> | #include <LibGUI/Action.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
|  | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/ScrollBar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  |  | ||||||
|  | @ -30,9 +30,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Painter; |  | ||||||
| 
 |  | ||||||
| // FIXME: Rename this to something without "table cell" in the name.
 |  | ||||||
| class TableCellPaintingDelegate { | class TableCellPaintingDelegate { | ||||||
| public: | public: | ||||||
|     virtual ~TableCellPaintingDelegate() {} |     virtual ~TableCellPaintingDelegate() {} | ||||||
|  |  | ||||||
|  | @ -25,6 +25,7 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
|  | #include <AK/Vector.h> | ||||||
| #include <Kernel/KeyCode.h> | #include <Kernel/KeyCode.h> | ||||||
| #include <LibGUI/AbstractView.h> | #include <LibGUI/AbstractView.h> | ||||||
| #include <LibGUI/DragOperation.h> | #include <LibGUI/DragOperation.h> | ||||||
|  |  | ||||||
|  | @ -27,14 +27,11 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <LibGUI/Model.h> |  | ||||||
| #include <LibGUI/ModelSelection.h> | #include <LibGUI/ModelSelection.h> | ||||||
| #include <LibGUI/ScrollableWidget.h> | #include <LibGUI/ScrollableWidget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class ModelEditingDelegate; |  | ||||||
| 
 |  | ||||||
| class AbstractView : public ScrollableWidget { | class AbstractView : public ScrollableWidget { | ||||||
|     C_OBJECT_ABSTRACT(AbstractView) |     C_OBJECT_ABSTRACT(AbstractView) | ||||||
|     friend class Model; |     friend class Model; | ||||||
|  |  | ||||||
|  | @ -35,16 +35,12 @@ | ||||||
| #include <AK/WeakPtr.h> | #include <AK/WeakPtr.h> | ||||||
| #include <AK/Weakable.h> | #include <AK/Weakable.h> | ||||||
| #include <LibCore/Object.h> | #include <LibCore/Object.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGUI/Shortcut.h> | #include <LibGUI/Shortcut.h> | ||||||
| #include <LibGfx/Forward.h> | #include <LibGfx/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| class ActionGroup; |  | ||||||
| class Button; |  | ||||||
| class MenuItem; |  | ||||||
| 
 |  | ||||||
| namespace CommonActions { | namespace CommonActions { | ||||||
|     NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::Object* parent = nullptr); |     NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::Object* parent = nullptr); | ||||||
|     NonnullRefPtr<Action> make_undo_action(Function<void(Action&)>, Core::Object* parent = nullptr); |     NonnullRefPtr<Action> make_undo_action(Function<void(Action&)>, Core::Object* parent = nullptr); | ||||||
|  |  | ||||||
|  | @ -28,11 +28,10 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/HashTable.h> | #include <AK/HashTable.h> | ||||||
| #include <AK/Weakable.h> | #include <AK/Weakable.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| 
 |  | ||||||
| class ActionGroup : public Weakable<ActionGroup> { | class ActionGroup : public Weakable<ActionGroup> { | ||||||
| public: | public: | ||||||
|     ActionGroup() {} |     ActionGroup() {} | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <LibCore/EventLoop.h> | ||||||
| #include <LibGUI/Action.h> | #include <LibGUI/Action.h> | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
|  |  | ||||||
|  | @ -28,15 +28,13 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/HashMap.h> | #include <AK/HashMap.h> | ||||||
| #include <AK/OwnPtr.h> | #include <AK/OwnPtr.h> | ||||||
|  | #include <AK/String.h> | ||||||
| #include <LibCore/Forward.h> | #include <LibCore/Forward.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGUI/Shortcut.h> | #include <LibGUI/Shortcut.h> | ||||||
| #include <LibGfx/Forward.h> | #include <LibGfx/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| class Action; |  | ||||||
| class KeyEvent; |  | ||||||
| class MenuBar; |  | ||||||
| class Window; |  | ||||||
| 
 | 
 | ||||||
| class Application { | class Application { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -25,6 +25,8 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
|  | #include <LibGUI/Widget.h> | ||||||
|  | #include <LibGfx/Orientation.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
| //#define GBOXLAYOUT_DEBUG
 | //#define GBOXLAYOUT_DEBUG
 | ||||||
|  |  | ||||||
|  | @ -26,28 +26,29 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGUI/Layout.h> | #include <LibGUI/Layout.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGfx/Orientation.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class BoxLayout : public Layout { | class BoxLayout : public Layout { | ||||||
| public: | public: | ||||||
|     explicit BoxLayout(Orientation); |     explicit BoxLayout(Gfx::Orientation); | ||||||
|     virtual ~BoxLayout() override {} |     virtual ~BoxLayout() override {} | ||||||
| 
 | 
 | ||||||
|     Orientation orientation() const { return m_orientation; } |     Gfx::Orientation orientation() const { return m_orientation; } | ||||||
| 
 | 
 | ||||||
|     virtual void run(Widget&) override; |     virtual void run(Widget&) override; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     Orientation m_orientation; |     Gfx::Orientation m_orientation; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class VerticalBoxLayout final : public BoxLayout { | class VerticalBoxLayout final : public BoxLayout { | ||||||
| public: | public: | ||||||
|     explicit VerticalBoxLayout() |     explicit VerticalBoxLayout() | ||||||
|         : BoxLayout(Orientation::Vertical) |         : BoxLayout(Gfx::Orientation::Vertical) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
|     virtual ~VerticalBoxLayout() override {} |     virtual ~VerticalBoxLayout() override {} | ||||||
|  | @ -56,7 +57,7 @@ public: | ||||||
| class HorizontalBoxLayout final : public BoxLayout { | class HorizontalBoxLayout final : public BoxLayout { | ||||||
| public: | public: | ||||||
|     explicit HorizontalBoxLayout() |     explicit HorizontalBoxLayout() | ||||||
|         : BoxLayout(Orientation::Horizontal) |         : BoxLayout(Gfx::Orientation::Horizontal) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
|     virtual ~HorizontalBoxLayout() override {} |     virtual ~HorizontalBoxLayout() override {} | ||||||
|  |  | ||||||
|  | @ -35,8 +35,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| 
 |  | ||||||
| class Button : public AbstractButton { | class Button : public AbstractButton { | ||||||
|     C_OBJECT(Button) |     C_OBJECT(Button) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -26,8 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> |  | ||||||
| #include <AK/String.h> |  | ||||||
| #include <LibGUI/AbstractButton.h> | #include <LibGUI/AbstractButton.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Badge.h> | ||||||
| #include <AK/SharedBuffer.h> | #include <AK/SharedBuffer.h> | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/WindowServerConnection.h> | #include <LibGUI/WindowServerConnection.h> | ||||||
|  |  | ||||||
|  | @ -26,14 +26,12 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Badge.h> |  | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <AK/String.h> | #include <AK/String.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class WindowServerConnection; |  | ||||||
| 
 |  | ||||||
| class Clipboard { | class Clipboard { | ||||||
| public: | public: | ||||||
|     static Clipboard& the(); |     static Clipboard& the(); | ||||||
|  |  | ||||||
|  | @ -30,8 +30,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Frame; |  | ||||||
| 
 |  | ||||||
| class ColorPicker final : public Dialog { | class ColorPicker final : public Dialog { | ||||||
|     C_OBJECT(ColorPicker) |     C_OBJECT(ColorPicker) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -25,6 +25,7 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/ColumnsView.h> | #include <LibGUI/ColumnsView.h> | ||||||
|  | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/ScrollBar.h> | ||||||
| #include <LibGfx/CharacterBitmap.h> | #include <LibGfx/CharacterBitmap.h> | ||||||
|  |  | ||||||
|  | @ -28,6 +28,7 @@ | ||||||
| #include <LibGUI/ComboBox.h> | #include <LibGUI/ComboBox.h> | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
| #include <LibGUI/ListView.h> | #include <LibGUI/ListView.h> | ||||||
|  | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/ScrollBar.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  |  | ||||||
|  | @ -31,9 +31,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Button; |  | ||||||
| class TextEditor; |  | ||||||
| 
 |  | ||||||
| class ComboBox : public Widget { | class ComboBox : public Widget { | ||||||
|     C_OBJECT(ComboBox) |     C_OBJECT(ComboBox) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Badge.h> | ||||||
| #include <LibCore/ConfigFile.h> | #include <LibCore/ConfigFile.h> | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
| #include <LibGUI/WindowServerConnection.h> | #include <LibGUI/WindowServerConnection.h> | ||||||
|  |  | ||||||
|  | @ -26,15 +26,13 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Badge.h> |  | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <AK/String.h> | #include <AK/String.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGfx/Rect.h> | #include <LibGfx/Rect.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class WindowServerConnection; |  | ||||||
| 
 |  | ||||||
| class Desktop { | class Desktop { | ||||||
| public: | public: | ||||||
|     static Desktop& the(); |     static Desktop& the(); | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <LibCore/EventLoop.h> | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
| #include <LibGUI/Dialog.h> | #include <LibGUI/Dialog.h> | ||||||
| #include <LibGUI/Event.h> | #include <LibGUI/Event.h> | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <LibCore/EventLoop.h> |  | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
|  |  | ||||||
|  | @ -26,6 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/Badge.h> | #include <AK/Badge.h> | ||||||
| #include <AK/SharedBuffer.h> | #include <AK/SharedBuffer.h> | ||||||
|  | #include <LibCore/EventLoop.h> | ||||||
| #include <LibGUI/DragOperation.h> | #include <LibGUI/DragOperation.h> | ||||||
| #include <LibGUI/WindowServerConnection.h> | #include <LibGUI/WindowServerConnection.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
|  |  | ||||||
|  | @ -27,14 +27,12 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/OwnPtr.h> | #include <AK/OwnPtr.h> | ||||||
| #include <LibCore/EventLoop.h> |  | ||||||
| #include <LibCore/Object.h> | #include <LibCore/Object.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGfx/Forward.h> | #include <LibGfx/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class WindowServerConnection; |  | ||||||
| 
 |  | ||||||
| class DragOperation : public Core::Object { | class DragOperation : public Core::Object { | ||||||
|     C_OBJECT(DragOperation) |     C_OBJECT(DragOperation) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -32,10 +32,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class FileSystemModel; |  | ||||||
| class Label; |  | ||||||
| class TextBox; |  | ||||||
| 
 |  | ||||||
| class FilePicker final : public Dialog { | class FilePicker final : public Dialog { | ||||||
|     C_OBJECT(FilePicker) |     C_OBJECT(FilePicker) | ||||||
| public: | public: | ||||||
|  |  | ||||||
							
								
								
									
										77
									
								
								Libraries/LibGUI/Forward.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								Libraries/LibGUI/Forward.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,77 @@ | ||||||
|  | /*
 | ||||||
|  |  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> | ||||||
|  |  * All rights reserved. | ||||||
|  |  * | ||||||
|  |  * Redistribution and use in source and binary forms, with or without | ||||||
|  |  * modification, are permitted provided that the following conditions are met: | ||||||
|  |  * | ||||||
|  |  * 1. Redistributions of source code must retain the above copyright notice, this | ||||||
|  |  *    list of conditions and the following disclaimer. | ||||||
|  |  * | ||||||
|  |  * 2. Redistributions in binary form must reproduce the above copyright notice, | ||||||
|  |  *    this list of conditions and the following disclaimer in the documentation | ||||||
|  |  *    and/or other materials provided with the distribution. | ||||||
|  |  * | ||||||
|  |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||||||
|  |  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||||||
|  |  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||||||
|  |  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||||||
|  |  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||||
|  |  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||||||
|  |  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||||||
|  |  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||||||
|  |  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||||||
|  |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | namespace GUI { | ||||||
|  | 
 | ||||||
|  | class AbstractButton; | ||||||
|  | class AbstractTableView; | ||||||
|  | class AbstractView; | ||||||
|  | class Action; | ||||||
|  | class ActionGroup; | ||||||
|  | class Application; | ||||||
|  | class BoxLayout; | ||||||
|  | class Button; | ||||||
|  | class Command; | ||||||
|  | class FileSystemModel; | ||||||
|  | class Frame; | ||||||
|  | class HorizontalBoxLayout; | ||||||
|  | class ItemView; | ||||||
|  | class JsonArrayModel; | ||||||
|  | class KeyEvent; | ||||||
|  | class Label; | ||||||
|  | class Layout; | ||||||
|  | class Menu; | ||||||
|  | class MenuBar; | ||||||
|  | class MenuItem; | ||||||
|  | class Model; | ||||||
|  | class ModelEditingDelegate; | ||||||
|  | class ModelIndex; | ||||||
|  | class MouseEvent; | ||||||
|  | class PaintEvent; | ||||||
|  | class Painter; | ||||||
|  | class ResizeCorner; | ||||||
|  | class ScrollBar; | ||||||
|  | class Slider; | ||||||
|  | class Splitter; | ||||||
|  | class StackWidget; | ||||||
|  | class StatusBar; | ||||||
|  | class SyntaxHighlighter; | ||||||
|  | class TabWidget; | ||||||
|  | class TableView; | ||||||
|  | class TextBox; | ||||||
|  | class TextDocument; | ||||||
|  | class TextDocumentLine; | ||||||
|  | class TextDocumentUndoCommand; | ||||||
|  | class TextEditor; | ||||||
|  | class TreeView; | ||||||
|  | class Variant; | ||||||
|  | class VerticalBoxLayout; | ||||||
|  | class WMEvent; | ||||||
|  | class Widget; | ||||||
|  | class Window; | ||||||
|  | class WindowServerConnection; | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -26,6 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/String.h> | #include <AK/String.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
|  | #include <LibGfx/Bitmap.h> | ||||||
| 
 | 
 | ||||||
| GIcon::GIcon() | GIcon::GIcon() | ||||||
|     : m_impl(GIconImpl::create()) |     : m_impl(GIconImpl::create()) | ||||||
|  |  | ||||||
|  | @ -27,7 +27,9 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/HashMap.h> | #include <AK/HashMap.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <AK/NonnullRefPtr.h> | ||||||
|  | #include <AK/RefCounted.h> | ||||||
|  | #include <LibGfx/Forward.h> | ||||||
| 
 | 
 | ||||||
| class GIconImpl : public RefCounted<GIconImpl> { | class GIconImpl : public RefCounted<GIconImpl> { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -30,9 +30,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Button; |  | ||||||
| class TextEditor; |  | ||||||
| 
 |  | ||||||
| class InputBox : public Dialog { | class InputBox : public Dialog { | ||||||
|     C_OBJECT(InputBox) |     C_OBJECT(InputBox) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -26,16 +26,11 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> |  | ||||||
| #include <AK/HashMap.h> |  | ||||||
| #include <LibGUI/AbstractView.h> | #include <LibGUI/AbstractView.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class ScrollBar; |  | ||||||
| class Painter; |  | ||||||
| 
 |  | ||||||
| class ItemView : public AbstractView { | class ItemView : public AbstractView { | ||||||
|     C_OBJECT(ItemView) |     C_OBJECT(ItemView) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Badge.h> | ||||||
| #include <LibGUI/Layout.h> | #include <LibGUI/Layout.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,16 +26,14 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Badge.h> |  | ||||||
| #include <AK/OwnPtr.h> | #include <AK/OwnPtr.h> | ||||||
| #include <AK/Vector.h> | #include <AK/Vector.h> | ||||||
| #include <AK/WeakPtr.h> | #include <AK/WeakPtr.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGUI/Margins.h> | #include <LibGUI/Margins.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Widget; |  | ||||||
| 
 |  | ||||||
| class Layout { | class Layout { | ||||||
| public: | public: | ||||||
|     Layout(); |     Layout(); | ||||||
|  |  | ||||||
|  | @ -25,10 +25,11 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <Kernel/KeyCode.h> | #include <Kernel/KeyCode.h> | ||||||
| #include <LibGfx/Palette.h> |  | ||||||
| #include <LibGUI/ListView.h> | #include <LibGUI/ListView.h> | ||||||
|  | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/ScrollBar.h> | ||||||
|  | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,16 +26,10 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> |  | ||||||
| #include <AK/HashMap.h> |  | ||||||
| #include <LibGUI/AbstractView.h> | #include <LibGUI/AbstractView.h> | ||||||
| #include <LibGUI/Model.h> |  | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class ScrollBar; |  | ||||||
| class Painter; |  | ||||||
| 
 |  | ||||||
| class ListView : public AbstractView { | class ListView : public AbstractView { | ||||||
|     C_OBJECT(ListView) |     C_OBJECT(ListView) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -38,6 +38,7 @@ OBJS = \ | ||||||
|     MenuItem.o \
 |     MenuItem.o \
 | ||||||
|     MessageBox.o \
 |     MessageBox.o \
 | ||||||
|     Model.o \
 |     Model.o \
 | ||||||
|  |     ModelIndex.o \
 | ||||||
|     ModelSelection.o \
 |     ModelSelection.o \
 | ||||||
|     Painter.o \
 |     Painter.o \
 | ||||||
|     ProgressBar.o \
 |     ProgressBar.o \
 | ||||||
|  |  | ||||||
|  | @ -26,17 +26,13 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> |  | ||||||
| #include <AK/NonnullOwnPtrVector.h> | #include <AK/NonnullOwnPtrVector.h> | ||||||
| #include <AK/NonnullRefPtr.h> |  | ||||||
| #include <LibCore/Object.h> | #include <LibCore/Object.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGfx/Forward.h> | #include <LibGfx/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| class MenuItem; |  | ||||||
| 
 |  | ||||||
| class Menu final : public Core::Object { | class Menu final : public Core::Object { | ||||||
|     C_OBJECT(Menu) |     C_OBJECT(Menu) | ||||||
| public: | public: | ||||||
|  | @ -56,8 +52,6 @@ public: | ||||||
|     void popup(const Gfx::Point& screen_position); |     void popup(const Gfx::Point& screen_position); | ||||||
|     void dismiss(); |     void dismiss(); | ||||||
| 
 | 
 | ||||||
|     Function<void(unsigned)> on_item_activation; |  | ||||||
| 
 |  | ||||||
| private: | private: | ||||||
|     friend class MenuBar; |     friend class MenuBar; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -28,12 +28,10 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/Forward.h> | #include <AK/Forward.h> | ||||||
| #include <AK/NonnullRefPtrVector.h> | #include <AK/NonnullRefPtrVector.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Application; |  | ||||||
| class Menu; |  | ||||||
| 
 |  | ||||||
| class MenuBar { | class MenuBar { | ||||||
| public: | public: | ||||||
|     MenuBar(); |     MenuBar(); | ||||||
|  |  | ||||||
|  | @ -28,12 +28,10 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/Forward.h> | #include <AK/Forward.h> | ||||||
| #include <AK/RefPtr.h> | #include <AK/RefPtr.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| class Menu; |  | ||||||
| 
 |  | ||||||
| class MenuItem { | class MenuItem { | ||||||
| public: | public: | ||||||
|     enum class Type { |     enum class Type { | ||||||
|  |  | ||||||
|  | @ -38,8 +38,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class AbstractView; |  | ||||||
| 
 |  | ||||||
| enum class SortOrder { | enum class SortOrder { | ||||||
|     None, |     None, | ||||||
|     Ascending, |     Ascending, | ||||||
|  |  | ||||||
							
								
								
									
										39
									
								
								Libraries/LibGUI/ModelIndex.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								Libraries/LibGUI/ModelIndex.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,39 @@ | ||||||
|  | /*
 | ||||||
|  |  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> | ||||||
|  |  * All rights reserved. | ||||||
|  |  * | ||||||
|  |  * Redistribution and use in source and binary forms, with or without | ||||||
|  |  * modification, are permitted provided that the following conditions are met: | ||||||
|  |  * | ||||||
|  |  * 1. Redistributions of source code must retain the above copyright notice, this | ||||||
|  |  *    list of conditions and the following disclaimer. | ||||||
|  |  * | ||||||
|  |  * 2. Redistributions in binary form must reproduce the above copyright notice, | ||||||
|  |  *    this list of conditions and the following disclaimer in the documentation | ||||||
|  |  *    and/or other materials provided with the distribution. | ||||||
|  |  * | ||||||
|  |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||||||
|  |  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||||||
|  |  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||||||
|  |  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||||||
|  |  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||||
|  |  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||||||
|  |  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||||||
|  |  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||||||
|  |  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||||||
|  |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | #include <AK/String.h> | ||||||
|  | #include <LibGUI/ModelIndex.h> | ||||||
|  | 
 | ||||||
|  | namespace GUI { | ||||||
|  | 
 | ||||||
|  | const LogStream& operator<<(const LogStream& stream, const ModelIndex& value) | ||||||
|  | { | ||||||
|  |     if (value.internal_data()) | ||||||
|  |         return stream << String::format("ModelIndex(%d,%d,%p)", value.row(), value.column(), value.internal_data()); | ||||||
|  |     return stream << String::format("ModelIndex(%d,%d)", value.row(), value.column()); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -26,13 +26,11 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/LogStream.h> | #include <AK/Traits.h> | ||||||
| #include <AK/String.h> | #include <LibGUI/Forward.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Model; |  | ||||||
| 
 |  | ||||||
| class ModelIndex { | class ModelIndex { | ||||||
|     friend class Model; |     friend class Model; | ||||||
| 
 | 
 | ||||||
|  | @ -72,12 +70,7 @@ private: | ||||||
|     void* m_internal_data { nullptr }; |     void* m_internal_data { nullptr }; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| inline const LogStream& operator<<(const LogStream& stream, const ModelIndex& value) | const LogStream& operator<<(const LogStream&, const ModelIndex&); | ||||||
| { |  | ||||||
|     if (value.internal_data()) |  | ||||||
|         return stream << String::format("ModelIndex(%d,%d,%p)", value.row(), value.column(), value.internal_data()); |  | ||||||
|     return stream << String::format("ModelIndex(%d,%d)", value.row(), value.column()); |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -24,7 +24,9 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Badge.h> | ||||||
| #include <LibGUI/AbstractView.h> | #include <LibGUI/AbstractView.h> | ||||||
|  | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/ModelSelection.h> | #include <LibGUI/ModelSelection.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
|  |  | ||||||
|  | @ -27,12 +27,11 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/HashTable.h> | #include <AK/HashTable.h> | ||||||
|  | #include <AK/Vector.h> | ||||||
| #include <LibGUI/ModelIndex.h> | #include <LibGUI/ModelIndex.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class AbstractView; |  | ||||||
| 
 |  | ||||||
| class ModelSelection { | class ModelSelection { | ||||||
| public: | public: | ||||||
|     ModelSelection(AbstractView& view) |     ModelSelection(AbstractView& view) | ||||||
|  |  | ||||||
|  | @ -26,12 +26,11 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGfx/Painter.h> | #include <LibGfx/Painter.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Widget; |  | ||||||
| 
 |  | ||||||
| class Painter : public Gfx::Painter { | class Painter : public Gfx::Painter { | ||||||
| public: | public: | ||||||
|     explicit Painter(Widget&); |     explicit Painter(Widget&); | ||||||
|  |  | ||||||
|  | @ -24,11 +24,9 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <AK/Assertions.h> | #include <LibCore/Timer.h> | ||||||
| #include <AK/StdLibExtras.h> |  | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/ScrollBar.h> | ||||||
| #include <LibGfx/Bitmap.h> |  | ||||||
| #include <LibGfx/CharacterBitmap.h> | #include <LibGfx/CharacterBitmap.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| #include <LibGfx/StylePainter.h> | #include <LibGfx/StylePainter.h> | ||||||
|  |  | ||||||
|  | @ -27,7 +27,6 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <LibCore/Timer.h> |  | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
|  | @ -37,7 +36,7 @@ class ScrollBar final : public Widget { | ||||||
| public: | public: | ||||||
|     virtual ~ScrollBar() override; |     virtual ~ScrollBar() override; | ||||||
| 
 | 
 | ||||||
|     Orientation orientation() const { return m_orientation; } |     Gfx::Orientation orientation() const { return m_orientation; } | ||||||
| 
 | 
 | ||||||
|     bool is_scrollable() const { return max() != min(); } |     bool is_scrollable() const { return max() != min(); } | ||||||
| 
 | 
 | ||||||
|  | @ -101,7 +100,7 @@ private: | ||||||
|     int m_scrub_start_value { 0 }; |     int m_scrub_start_value { 0 }; | ||||||
|     Gfx::Point m_scrub_origin; |     Gfx::Point m_scrub_origin; | ||||||
| 
 | 
 | ||||||
|     Orientation m_orientation { Orientation::Vertical }; |     Gfx::Orientation m_orientation { Gfx::Orientation::Vertical }; | ||||||
|     Component m_hovered_component { Component::Invalid }; |     Component m_hovered_component { Component::Invalid }; | ||||||
|     bool m_scrubber_in_use { false }; |     bool m_scrubber_in_use { false }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -30,8 +30,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class ScrollBar; |  | ||||||
| 
 |  | ||||||
| class ScrollableWidget : public Frame { | class ScrollableWidget : public Frame { | ||||||
|     C_OBJECT(ScrollableWidget) |     C_OBJECT(ScrollableWidget) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/String.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <AK/Vector.h> | #include <AK/Vector.h> | ||||||
| #include <LibGUI/Shortcut.h> | #include <LibGUI/Shortcut.h> | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/String.h> |  | ||||||
| #include <AK/Traits.h> | #include <AK/Traits.h> | ||||||
| #include <Kernel/KeyCode.h> | #include <Kernel/KeyCode.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -30,9 +30,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Button; |  | ||||||
| class TextEditor; |  | ||||||
| 
 |  | ||||||
| class SpinBox : public Widget { | class SpinBox : public Widget { | ||||||
|     C_OBJECT(SpinBox) |     C_OBJECT(SpinBox) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ public: | ||||||
|     virtual ~Splitter() override; |     virtual ~Splitter() override; | ||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|     Splitter(Orientation, Widget* parent); |     Splitter(Gfx::Orientation, Widget* parent); | ||||||
| 
 | 
 | ||||||
|     virtual void paint_event(PaintEvent&) override; |     virtual void paint_event(PaintEvent&) override; | ||||||
|     virtual void resize_event(ResizeEvent&) override; |     virtual void resize_event(ResizeEvent&) override; | ||||||
|  | @ -52,7 +52,7 @@ private: | ||||||
|     void recompute_grabbable_rect(const Widget&, const Widget&); |     void recompute_grabbable_rect(const Widget&, const Widget&); | ||||||
|     bool get_resize_candidates_at(const Gfx::Point&, Widget*&, Widget*&); |     bool get_resize_candidates_at(const Gfx::Point&, Widget*&, Widget*&); | ||||||
| 
 | 
 | ||||||
|     Orientation m_orientation; |     Gfx::Orientation m_orientation; | ||||||
|     bool m_resizing { false }; |     bool m_resizing { false }; | ||||||
|     Gfx::Point m_resize_origin; |     Gfx::Point m_resize_origin; | ||||||
|     WeakPtr<Widget> m_first_resizee; |     WeakPtr<Widget> m_first_resizee; | ||||||
|  | @ -69,7 +69,7 @@ public: | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     explicit VerticalSplitter(Widget* parent) |     explicit VerticalSplitter(Widget* parent) | ||||||
|         : Splitter(Orientation::Vertical, parent) |         : Splitter(Gfx::Orientation::Vertical, parent) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
|  | @ -81,7 +81,7 @@ public: | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     explicit HorizontalSplitter(Widget* parent) |     explicit HorizontalSplitter(Widget* parent) | ||||||
|         : Splitter(Orientation::Horizontal, parent) |         : Splitter(Gfx::Orientation::Horizontal, parent) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -30,9 +30,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Label; |  | ||||||
| class ResizeCorner; |  | ||||||
| 
 |  | ||||||
| class StatusBar : public Widget { | class StatusBar : public Widget { | ||||||
|     C_OBJECT(StatusBar) |     C_OBJECT(StatusBar) | ||||||
| public: | public: | ||||||
|  |  | ||||||
|  | @ -6,8 +6,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class TextEditor; |  | ||||||
| 
 |  | ||||||
| class SyntaxHighlighter { | class SyntaxHighlighter { | ||||||
|     AK_MAKE_NONCOPYABLE(SyntaxHighlighter); |     AK_MAKE_NONCOPYABLE(SyntaxHighlighter); | ||||||
|     AK_MAKE_NONMOVABLE(SyntaxHighlighter); |     AK_MAKE_NONMOVABLE(SyntaxHighlighter); | ||||||
|  |  | ||||||
|  | @ -26,10 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> |  | ||||||
| #include <AK/HashMap.h> |  | ||||||
| #include <LibGUI/AbstractTableView.h> | #include <LibGUI/AbstractTableView.h> | ||||||
| #include <LibGUI/Model.h> |  | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> |  | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Badge.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibCore/Timer.h> | #include <LibCore/Timer.h> | ||||||
| #include <LibGUI/TextDocument.h> | #include <LibGUI/TextDocument.h> | ||||||
|  | @ -32,6 +33,11 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  | NonnullRefPtr<TextDocument> TextDocument::create(Client* client) | ||||||
|  | { | ||||||
|  |     return adopt(*new TextDocument(client)); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| TextDocument::TextDocument(Client* client) | TextDocument::TextDocument(Client* client) | ||||||
| { | { | ||||||
|     if (client) |     if (client) | ||||||
|  | @ -45,6 +51,10 @@ TextDocument::TextDocument(Client* client) | ||||||
|         }); |         }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | TextDocument::~TextDocument() | ||||||
|  | { | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void TextDocument::set_text(const StringView& text) | void TextDocument::set_text(const StringView& text) | ||||||
| { | { | ||||||
|     m_client_notifications_enabled = false; |     m_client_notifications_enabled = false; | ||||||
|  |  | ||||||
|  | @ -26,13 +26,14 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Badge.h> |  | ||||||
| #include <AK/HashTable.h> | #include <AK/HashTable.h> | ||||||
| #include <AK/NonnullOwnPtrVector.h> | #include <AK/NonnullOwnPtrVector.h> | ||||||
| #include <AK/NonnullRefPtr.h> | #include <AK/NonnullRefPtr.h> | ||||||
| #include <AK/Optional.h> | #include <AK/Optional.h> | ||||||
| #include <AK/RefCounted.h> | #include <AK/RefCounted.h> | ||||||
| #include <LibCore/Timer.h> | #include <LibCore/Forward.h> | ||||||
|  | #include <LibGUI/Command.h> | ||||||
|  | #include <LibGUI/Forward.h> | ||||||
| #include <LibGUI/TextRange.h> | #include <LibGUI/TextRange.h> | ||||||
| #include <LibGUI/UndoStack.h> | #include <LibGUI/UndoStack.h> | ||||||
| #include <LibGfx/Color.h> | #include <LibGfx/Color.h> | ||||||
|  | @ -40,11 +41,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class TextDocument; |  | ||||||
| class TextDocumentLine; |  | ||||||
| class TextDocumentUndoCommand; |  | ||||||
| class TextEditor; |  | ||||||
| 
 |  | ||||||
| struct TextDocumentSpan { | struct TextDocumentSpan { | ||||||
|     TextRange range; |     TextRange range; | ||||||
|     Color color; |     Color color; | ||||||
|  | @ -76,10 +72,8 @@ public: | ||||||
|         virtual int soft_tab_width() const = 0; |         virtual int soft_tab_width() const = 0; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     static NonnullRefPtr<TextDocument> create(Client* client = nullptr) |     static NonnullRefPtr<TextDocument> create(Client* client = nullptr); | ||||||
|     { |     ~TextDocument(); | ||||||
|         return adopt(*new TextDocument(client)); |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     size_t line_count() const { return (size_t)m_lines.size(); } |     size_t line_count() const { return (size_t)m_lines.size(); } | ||||||
|     const TextDocumentLine& line(size_t line_index) const { return m_lines[(int)line_index]; } |     const TextDocumentLine& line(size_t line_index) const { return m_lines[(int)line_index]; } | ||||||
|  |  | ||||||
|  | @ -27,11 +27,9 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <AK/HashMap.h> |  | ||||||
| #include <AK/NonnullOwnPtrVector.h> | #include <AK/NonnullOwnPtrVector.h> | ||||||
| #include <AK/NonnullRefPtrVector.h> | #include <AK/NonnullRefPtrVector.h> | ||||||
| #include <LibCore/ElapsedTimer.h> | #include <LibCore/ElapsedTimer.h> | ||||||
| #include <LibCore/Timer.h> |  | ||||||
| #include <LibGUI/ScrollableWidget.h> | #include <LibGUI/ScrollableWidget.h> | ||||||
| #include <LibGUI/TextDocument.h> | #include <LibGUI/TextDocument.h> | ||||||
| #include <LibGUI/TextRange.h> | #include <LibGUI/TextRange.h> | ||||||
|  | @ -39,12 +37,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| class Menu; |  | ||||||
| class Painter; |  | ||||||
| class ScrollBar; |  | ||||||
| class SyntaxHighlighter; |  | ||||||
| 
 |  | ||||||
| class TextEditor | class TextEditor | ||||||
|     : public ScrollableWidget |     : public ScrollableWidget | ||||||
|     , public TextDocument::Client { |     , public TextDocument::Client { | ||||||
|  |  | ||||||
|  | @ -31,8 +31,6 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class Action; |  | ||||||
| 
 |  | ||||||
| class ToolBar : public Widget { | class ToolBar : public Widget { | ||||||
|     C_OBJECT(ToolBar) |     C_OBJECT(ToolBar) | ||||||
| public: | public: | ||||||
|  |  | ||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling