Bläddra i källkod

HackStudio: Move everything into the HackStudio namespace

Andreas Kling 5 år sedan
förälder
incheckning
c0462c65cf
40 ändrade filer med 184 tillägg och 18 borttagningar
  1. 6 0
      DevTools/HackStudio/CodeDocument.cpp
  2. 4 0
      DevTools/HackStudio/CodeDocument.h
  3. 4 0
      DevTools/HackStudio/CursorTool.cpp
  4. 5 1
      DevTools/HackStudio/CursorTool.h
  5. 4 0
      DevTools/HackStudio/Debugger/BacktraceModel.cpp
  6. 5 1
      DevTools/HackStudio/Debugger/BacktraceModel.h
  7. 4 0
      DevTools/HackStudio/Debugger/BreakpointCallback.h
  8. 4 0
      DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
  9. 6 2
      DevTools/HackStudio/Debugger/DebugInfoWidget.h
  10. 5 0
      DevTools/HackStudio/Debugger/Debugger.cpp
  11. 4 0
      DevTools/HackStudio/Debugger/Debugger.h
  12. 4 0
      DevTools/HackStudio/Debugger/VariablesModel.cpp
  13. 4 0
      DevTools/HackStudio/Debugger/VariablesModel.h
  14. 4 0
      DevTools/HackStudio/Editor.cpp
  15. 4 0
      DevTools/HackStudio/Editor.h
  16. 4 0
      DevTools/HackStudio/EditorWrapper.cpp
  17. 5 1
      DevTools/HackStudio/EditorWrapper.h
  18. 4 0
      DevTools/HackStudio/FindInFilesWidget.cpp
  19. 5 1
      DevTools/HackStudio/FindInFilesWidget.h
  20. 4 0
      DevTools/HackStudio/FormEditorWidget.cpp
  21. 5 1
      DevTools/HackStudio/FormEditorWidget.h
  22. 4 0
      DevTools/HackStudio/FormWidget.cpp
  23. 4 0
      DevTools/HackStudio/FormWidget.h
  24. 4 0
      DevTools/HackStudio/HackStudio.h
  25. 4 0
      DevTools/HackStudio/Locator.cpp
  26. 4 0
      DevTools/HackStudio/Locator.h
  27. 4 0
      DevTools/HackStudio/ProcessStateWidget.cpp
  28. 4 0
      DevTools/HackStudio/ProcessStateWidget.h
  29. 4 0
      DevTools/HackStudio/Project.cpp
  30. 4 0
      DevTools/HackStudio/Project.h
  31. 4 0
      DevTools/HackStudio/ProjectFile.cpp
  32. 4 0
      DevTools/HackStudio/ProjectFile.h
  33. 4 0
      DevTools/HackStudio/TerminalWrapper.cpp
  34. 6 1
      DevTools/HackStudio/TerminalWrapper.h
  35. 8 4
      DevTools/HackStudio/Tool.h
  36. 4 0
      DevTools/HackStudio/WidgetTool.cpp
  37. 4 4
      DevTools/HackStudio/WidgetTool.h
  38. 4 1
      DevTools/HackStudio/WidgetTreeModel.cpp
  39. 4 0
      DevTools/HackStudio/WidgetTreeModel.h
  40. 12 1
      DevTools/HackStudio/main.cpp

+ 6 - 0
DevTools/HackStudio/CodeDocument.cpp

@@ -23,12 +23,16 @@
  * 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 "CodeDocument.h"
 
+namespace HackStudio {
+
 NonnullRefPtr<CodeDocument> CodeDocument::create(Client* client)
 {
     return adopt(*new CodeDocument(client));
 }
+
 CodeDocument::CodeDocument(Client* client)
     : TextDocument(client)
 {
@@ -37,3 +41,5 @@ CodeDocument::CodeDocument(Client* client)
 CodeDocument::~CodeDocument()
 {
 }
+
+}

+ 4 - 0
DevTools/HackStudio/CodeDocument.h

@@ -28,6 +28,8 @@
 
 #include <LibGUI/TextDocument.h>
 
+namespace HackStudio {
+
 class CodeDocument final : public GUI::TextDocument {
 public:
     virtual ~CodeDocument() override;
@@ -47,3 +49,5 @@ private:
     Vector<size_t> m_breakpoint_lines;
     Optional<size_t> m_execution_position;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/CursorTool.cpp

@@ -31,6 +31,8 @@
 #include <AK/LogStream.h>
 #include <LibGfx/Palette.h>
 
+namespace HackStudio {
+
 void CursorTool::on_mousedown(GUI::MouseEvent& event)
 {
     dbg() << "CursorTool::on_mousedown";
@@ -186,3 +188,5 @@ void CursorTool::on_second_paint(GUI::Painter& painter, GUI::PaintEvent&)
     painter.fill_rect(rect, m_editor.palette().rubber_band_fill());
     painter.draw_rect(rect, m_editor.palette().rubber_band_border());
 }
+
+}

+ 5 - 1
DevTools/HackStudio/CursorTool.h

@@ -31,13 +31,15 @@
 #include <LibGUI/Forward.h>
 #include <LibGfx/Point.h>
 
+namespace HackStudio {
+
 class CursorTool final : public Tool {
 public:
     explicit CursorTool(FormEditorWidget& editor)
         : Tool(editor)
     {
     }
-    virtual ~CursorTool() override {}
+    virtual ~CursorTool() override { }
 
 private:
     virtual const char* class_name() const override { return "CursorTool"; }
@@ -58,3 +60,5 @@ private:
     Gfx::IntPoint m_rubber_band_origin;
     Gfx::IntPoint m_rubber_band_position;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/Debugger/BacktraceModel.cpp

@@ -27,6 +27,8 @@
 #include "BacktraceModel.h"
 #include "Debugger.h"
 
+namespace HackStudio {
+
 NonnullRefPtr<BacktraceModel> BacktraceModel::create(const DebugSession& debug_session, const PtraceRegisters& regs)
 {
     return adopt(*new BacktraceModel(create_backtrace(debug_session, regs)));
@@ -66,3 +68,5 @@ Vector<BacktraceModel::FrameInfo> BacktraceModel::create_backtrace(const DebugSe
     } while (current_ebp && current_instruction);
     return frames;
 }
+
+}

+ 5 - 1
DevTools/HackStudio/Debugger/BacktraceModel.h

@@ -33,6 +33,8 @@
 
 class DebugSession;
 
+namespace HackStudio {
+
 class BacktraceModel final : public GUI::Model {
 public:
     static NonnullRefPtr<BacktraceModel> create(const DebugSession&, const PtraceRegisters& regs);
@@ -47,7 +49,7 @@ public:
 
     virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
 
-    virtual void update() override {}
+    virtual void update() override { }
     virtual GUI::ModelIndex index(int row, int column, const GUI::ModelIndex&) const override;
 
     struct FrameInfo {
@@ -68,3 +70,5 @@ private:
 
     Vector<FrameInfo> m_frames;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/Debugger/BreakpointCallback.h

@@ -30,9 +30,13 @@
 #include <AK/String.h>
 #include <AK/Types.h>
 
+namespace HackStudio {
+
 enum class BreakpointChange {
     Added,
     Removed,
 };
 
 typedef Function<void(const String& file, size_t line, BreakpointChange)> BreakpointChangeCallback;
+
+}

+ 4 - 0
DevTools/HackStudio/Debugger/DebugInfoWidget.cpp

@@ -38,6 +38,8 @@
 #include <LibGUI/Splitter.h>
 #include <LibGUI/TreeView.h>
 
+namespace HackStudio {
+
 DebugInfoWidget::DebugInfoWidget()
 {
     set_layout<GUI::HorizontalBoxLayout>();
@@ -108,3 +110,5 @@ void DebugInfoWidget::program_stopped()
 {
     m_variables_view->set_model({});
 }
+
+}

+ 6 - 2
DevTools/HackStudio/Debugger/DebugInfoWidget.h

@@ -27,16 +27,18 @@
 #pragma once
 
 #include "Debugger.h"
-#include "LibGUI/ListView.h"
 #include <AK/NonnullOwnPtr.h>
+#include <LibGUI/ListView.h>
 #include <LibGUI/Model.h>
 #include <LibGUI/Widget.h>
 #include <sys/arch/i386/regs.h>
 
+namespace HackStudio {
+
 class DebugInfoWidget final : public GUI::Widget {
     C_OBJECT(DebugInfoWidget)
 public:
-    virtual ~DebugInfoWidget() override {}
+    virtual ~DebugInfoWidget() override { }
 
     void update_state(const DebugSession&, const PtraceRegisters&);
     void program_stopped();
@@ -48,3 +50,5 @@ private:
     RefPtr<GUI::ListView> m_backtrace_view;
     RefPtr<GUI::Menu> m_variable_context_menu;
 };
+
+}

+ 5 - 0
DevTools/HackStudio/Debugger/Debugger.cpp

@@ -26,6 +26,8 @@
 
 #include "Debugger.h"
 
+namespace HackStudio {
+
 static Debugger* s_the;
 
 Debugger& Debugger::the()
@@ -183,8 +185,11 @@ void Debugger::DebuggingState::set_single_stepping(DebugInfo::SourcePosition ori
     m_state = State::SingleStepping;
     m_original_source_position = original_source_position;
 }
+
 bool Debugger::DebuggingState::should_stop_single_stepping(const DebugInfo::SourcePosition& current_source_position) const
 {
     ASSERT(m_state == State::SingleStepping);
     return m_original_source_position.value() != current_source_position;
 }
+
+}

+ 4 - 0
DevTools/HackStudio/Debugger/Debugger.h

@@ -33,6 +33,8 @@
 #include <LibThread/Lock.h>
 #include <LibThread/Thread.h>
 
+namespace HackStudio {
+
 class Debugger {
 public:
     static Debugger& the();
@@ -110,3 +112,5 @@ private:
 
     ContinueType m_continue_type { ContinueType::Continue };
 };
+
+}

+ 4 - 0
DevTools/HackStudio/Debugger/VariablesModel.cpp

@@ -28,6 +28,8 @@
 #include <LibGUI/Application.h>
 #include <LibGUI/MessageBox.h>
 
+namespace HackStudio {
+
 GUI::ModelIndex VariablesModel::index(int row, int column, const GUI::ModelIndex& parent_index) const
 {
     if (!parent_index.is_valid())
@@ -184,3 +186,5 @@ RefPtr<VariablesModel> VariablesModel::create(const PtraceRegisters& regs)
     auto variables = Debugger::the().session()->debug_info().get_variables_in_current_scope(regs);
     return adopt(*new VariablesModel(move(variables), regs));
 }
+
+}

+ 4 - 0
DevTools/HackStudio/Debugger/VariablesModel.h

@@ -32,6 +32,8 @@
 #include <LibGUI/TreeView.h>
 #include <sys/arch/i386/regs.h>
 
+namespace HackStudio {
+
 class VariablesModel final : public GUI::Model {
 public:
     static RefPtr<VariablesModel> create(const PtraceRegisters& regs);
@@ -57,3 +59,5 @@ private:
 
     GUI::Icon m_variable_icon;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/Editor.cpp

@@ -44,6 +44,8 @@
 
 // #define EDITOR_DEBUG
 
+namespace HackStudio {
+
 Editor::Editor()
 {
     m_documentation_tooltip_window = GUI::Window::construct();
@@ -417,3 +419,5 @@ void Editor::set_document(GUI::TextDocument& doc)
     ASSERT(doc.is_code_document());
     GUI::TextEditor::set_document(doc);
 }
+
+}

+ 4 - 0
DevTools/HackStudio/Editor.h

@@ -32,6 +32,8 @@
 #include <LibGUI/TextEditor.h>
 #include <LibWeb/Forward.h>
 
+namespace HackStudio {
+
 class EditorWrapper;
 
 class Editor final : public GUI::TextEditor {
@@ -86,3 +88,5 @@ private:
     bool m_hovering_link { false };
     bool m_holding_ctrl { false };
 };
+
+}

+ 4 - 0
DevTools/HackStudio/EditorWrapper.cpp

@@ -33,6 +33,8 @@
 #include <LibGUI/Label.h>
 #include <LibGfx/Font.h>
 
+namespace HackStudio {
+
 EditorWrapper::EditorWrapper(BreakpointChangeCallback breakpoint_change_callback)
 {
     set_layout<GUI::VerticalBoxLayout>();
@@ -82,3 +84,5 @@ void EditorWrapper::set_editor_has_focus(Badge<Editor>, bool focus)
 {
     m_filename_label->set_font(focus ? Gfx::Font::default_bold_font() : Gfx::Font::default_font());
 }
+
+}

+ 5 - 1
DevTools/HackStudio/EditorWrapper.h

@@ -32,6 +32,8 @@
 #include <LibGUI/Widget.h>
 #include <string.h>
 
+namespace HackStudio {
+
 class Editor;
 
 class EditorWrapper : public GUI::Widget {
@@ -55,6 +57,8 @@ private:
     RefPtr<Editor> m_editor;
 };
 
-AK_BEGIN_TYPE_TRAITS(EditorWrapper)
+}
+
+AK_BEGIN_TYPE_TRAITS(HackStudio::EditorWrapper)
 static bool is_type(const Core::Object& object) { return !strcmp(object.class_name(), "EditorWrapper"); }
 AK_END_TYPE_TRAITS()

+ 4 - 0
DevTools/HackStudio/FindInFilesWidget.cpp

@@ -33,6 +33,8 @@
 #include <LibGUI/TableView.h>
 #include <LibGUI/TextBox.h>
 
+namespace HackStudio {
+
 struct Match {
     String filename;
     GUI::TextRange range;
@@ -162,3 +164,5 @@ void FindInFilesWidget::focus_textbox_and_select_all()
     m_textbox->select_all();
     m_textbox->set_focus(true);
 }
+
+}

+ 5 - 1
DevTools/HackStudio/FindInFilesWidget.h

@@ -28,10 +28,12 @@
 
 #include <LibGUI/Widget.h>
 
+namespace HackStudio {
+
 class FindInFilesWidget final : public GUI::Widget {
     C_OBJECT(FindInFilesWidget)
 public:
-    virtual ~FindInFilesWidget() override {}
+    virtual ~FindInFilesWidget() override { }
 
     void focus_textbox_and_select_all();
 
@@ -42,3 +44,5 @@ private:
     RefPtr<GUI::Button> m_button;
     RefPtr<GUI::TableView> m_result_view;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/FormEditorWidget.cpp

@@ -30,6 +30,8 @@
 #include "WidgetTreeModel.h"
 #include <LibGUI/Painter.h>
 
+namespace HackStudio {
+
 FormEditorWidget::FormEditorWidget()
     : m_tool(make<CursorTool>(*this))
 {
@@ -63,3 +65,5 @@ WidgetTreeModel& FormEditorWidget::model()
 {
     return *m_widget_tree_model;
 }
+
+}

+ 5 - 1
DevTools/HackStudio/FormEditorWidget.h

@@ -29,6 +29,8 @@
 #include <AK/HashTable.h>
 #include <LibGUI/ScrollableWidget.h>
 
+namespace HackStudio {
+
 class FormWidget;
 class Tool;
 class WidgetTreeModel;
@@ -112,7 +114,7 @@ public:
             }
         }
 
-        WidgetSelection() {}
+        WidgetSelection() { }
 
     private:
         HashTable<GUI::Widget*> m_widgets;
@@ -131,3 +133,5 @@ private:
     NonnullOwnPtr<Tool> m_tool;
     WidgetSelection m_selection;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/FormWidget.cpp

@@ -29,6 +29,8 @@
 #include "Tool.h"
 #include <LibGUI/Painter.h>
 
+namespace HackStudio {
+
 FormWidget::FormWidget()
 {
     set_fill_with_background_color(true);
@@ -99,3 +101,5 @@ void FormWidget::keydown_event(GUI::KeyEvent& event)
 {
     editor().tool().on_keydown(event);
 }
+
+}

+ 4 - 0
DevTools/HackStudio/FormWidget.h

@@ -29,6 +29,8 @@
 #include <AK/Badge.h>
 #include <LibGUI/Widget.h>
 
+namespace HackStudio {
+
 class CursorTool;
 class FormEditorWidget;
 
@@ -57,3 +59,5 @@ private:
 
     int m_grid_size { 5 };
 };
+
+}

+ 4 - 0
DevTools/HackStudio/HackStudio.h

@@ -31,6 +31,8 @@
 #include <AK/String.h>
 #include <LibGUI/TextEditor.h>
 
+namespace HackStudio {
+
 GUI::TextEditor& current_editor();
 void open_file(const String&);
 
@@ -38,3 +40,5 @@ extern RefPtr<EditorWrapper> g_current_editor_wrapper;
 extern Function<void(String)> g_open_file;
 extern OwnPtr<Project> g_project;
 extern String g_currently_open_file;
+
+}

+ 4 - 0
DevTools/HackStudio/Locator.cpp

@@ -32,6 +32,8 @@
 #include <LibGUI/TextBox.h>
 #include <LibGUI/Window.h>
 
+namespace HackStudio {
+
 static RefPtr<Gfx::Bitmap> s_file_icon;
 static RefPtr<Gfx::Bitmap> s_cplusplus_icon;
 static RefPtr<Gfx::Bitmap> s_header_icon;
@@ -187,3 +189,5 @@ void Locator::update_suggestions()
     dbg() << "Popup rect: " << m_popup_window->rect();
     m_popup_window->show();
 }
+
+}

+ 4 - 0
DevTools/HackStudio/Locator.h

@@ -28,6 +28,8 @@
 
 #include <LibGUI/Widget.h>
 
+namespace HackStudio {
+
 class Locator final : public GUI::Widget {
     C_OBJECT(Locator)
 public:
@@ -46,3 +48,5 @@ private:
     RefPtr<GUI::Window> m_popup_window;
     RefPtr<GUI::TableView> m_suggestion_view;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/ProcessStateWidget.cpp

@@ -32,6 +32,8 @@
 #include <LibGfx/Font.h>
 #include <unistd.h>
 
+namespace HackStudio {
+
 ProcessStateWidget::ProcessStateWidget()
 {
     set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
@@ -96,3 +98,5 @@ void ProcessStateWidget::set_tty_fd(int tty_fd)
     set_visible(true);
     refresh();
 }
+
+}

+ 4 - 0
DevTools/HackStudio/ProcessStateWidget.h

@@ -28,6 +28,8 @@
 
 #include <LibGUI/Widget.h>
 
+namespace HackStudio {
+
 class ProcessStateWidget final : public GUI::Widget {
     C_OBJECT(ProcessStateWidget)
 public:
@@ -49,3 +51,5 @@ private:
 
     int m_tty_fd { -1 };
 };
+
+}

+ 4 - 0
DevTools/HackStudio/Project.cpp

@@ -36,6 +36,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+namespace HackStudio {
+
 struct Project::ProjectTreeNode : public RefCounted<ProjectTreeNode> {
     enum class Type {
         Invalid,
@@ -358,3 +360,5 @@ void Project::rebuild_tree()
     m_root_node = move(root);
     m_model->update();
 }
+
+}

+ 4 - 0
DevTools/HackStudio/Project.h

@@ -33,6 +33,8 @@
 #include <LibGUI/Icon.h>
 #include <LibGUI/Model.h>
 
+namespace HackStudio {
+
 enum class ProjectType {
     Unknown,
     Cpp,
@@ -88,3 +90,5 @@ private:
     GUI::Icon m_header_icon;
     GUI::Icon m_project_icon;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/ProjectFile.cpp

@@ -28,6 +28,8 @@
 #include <LibCore/File.h>
 #include <string.h>
 
+namespace HackStudio {
+
 ProjectFile::ProjectFile(const String& name)
     : m_name(name)
 {
@@ -45,3 +47,5 @@ const GUI::TextDocument& ProjectFile::document() const
     }
     return *m_document;
 }
+
+}

+ 4 - 0
DevTools/HackStudio/ProjectFile.h

@@ -32,6 +32,8 @@
 #include <AK/RefCounted.h>
 #include <AK/String.h>
 
+namespace HackStudio {
+
 class ProjectFile : public RefCounted<ProjectFile> {
 public:
     static NonnullRefPtr<ProjectFile> construct_with_name(const String& name)
@@ -49,3 +51,5 @@ private:
     String m_name;
     mutable RefPtr<CodeDocument> m_document;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/TerminalWrapper.cpp

@@ -41,6 +41,8 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
+namespace HackStudio {
+
 void TerminalWrapper::run_command(const String& command)
 {
     if (m_pid != -1) {
@@ -183,3 +185,5 @@ TerminalWrapper::TerminalWrapper(bool user_spawned)
 TerminalWrapper::~TerminalWrapper()
 {
 }
+
+}

+ 6 - 1
DevTools/HackStudio/TerminalWrapper.h

@@ -28,9 +28,12 @@
 
 #include <LibGUI/Widget.h>
 
-class ProcessStateWidget;
 class TerminalWidget;
 
+namespace HackStudio {
+
+class ProcessStateWidget;
+
 class TerminalWrapper final : public GUI::Widget {
     C_OBJECT(TerminalWrapper)
 public:
@@ -52,3 +55,5 @@ private:
     pid_t m_pid { -1 };
     bool m_user_spawned { true };
 };
+
+}

+ 8 - 4
DevTools/HackStudio/Tool.h

@@ -29,24 +29,26 @@
 #include <AK/Noncopyable.h>
 #include <LibGUI/Forward.h>
 
+namespace HackStudio {
+
 class FormEditorWidget;
 
 class Tool {
     AK_MAKE_NONCOPYABLE(Tool)
     AK_MAKE_NONMOVABLE(Tool)
 public:
-    virtual ~Tool() {}
+    virtual ~Tool() { }
 
     virtual void on_mousedown(GUI::MouseEvent&) = 0;
     virtual void on_mouseup(GUI::MouseEvent&) = 0;
     virtual void on_mousemove(GUI::MouseEvent&) = 0;
     virtual void on_keydown(GUI::KeyEvent&) = 0;
-    virtual void on_second_paint(GUI::Painter&, GUI::PaintEvent&) {}
+    virtual void on_second_paint(GUI::Painter&, GUI::PaintEvent&) { }
 
     virtual const char* class_name() const = 0;
 
-    virtual void attach() {}
-    virtual void detach() {}
+    virtual void attach() { }
+    virtual void detach() { }
 
 protected:
     explicit Tool(FormEditorWidget& editor)
@@ -56,3 +58,5 @@ protected:
 
     FormEditorWidget& m_editor;
 };
+
+}

+ 4 - 0
DevTools/HackStudio/WidgetTool.cpp

@@ -27,6 +27,8 @@
 #include "WidgetTool.h"
 #include <AK/LogStream.h>
 
+namespace HackStudio {
+
 void WidgetTool::on_mousedown(GUI::MouseEvent& event)
 {
     (void)event;
@@ -50,3 +52,5 @@ void WidgetTool::on_keydown(GUI::KeyEvent& event)
     (void)event;
     dbg() << "WidgetTool::on_keydown";
 }
+
+}

+ 4 - 4
DevTools/HackStudio/WidgetTool.h

@@ -28,9 +28,7 @@
 
 #include "Tool.h"
 
-namespace GUI {
-class WidgetClassRegistration;
-}
+namespace HackStudio {
 
 class WidgetTool final : public Tool {
 public:
@@ -39,7 +37,7 @@ public:
         , m_meta_class(meta_class)
     {
     }
-    virtual ~WidgetTool() override {}
+    virtual ~WidgetTool() override { }
 
 private:
     virtual const char* class_name() const override { return "WidgetTool"; }
@@ -50,3 +48,5 @@ private:
 
     const GUI::WidgetClassRegistration& m_meta_class;
 };
+
+}

+ 4 - 1
DevTools/HackStudio/WidgetTreeModel.cpp

@@ -27,7 +27,8 @@
 #include "WidgetTreeModel.h"
 #include <AK/StringBuilder.h>
 #include <LibGUI/Widget.h>
-#include <stdio.h>
+
+namespace HackStudio {
 
 WidgetTreeModel::WidgetTreeModel(GUI::Widget& root)
     : m_root(root)
@@ -112,3 +113,5 @@ GUI::ModelIndex WidgetTreeModel::index_for_widget(GUI::Widget& widget) const
     }
     return {};
 }
+
+}

+ 4 - 0
DevTools/HackStudio/WidgetTreeModel.h

@@ -29,6 +29,8 @@
 #include <LibGUI/Model.h>
 #include <LibGUI/Painter.h>
 
+namespace HackStudio {
+
 class WidgetTreeModel final : public GUI::Model {
 public:
     static NonnullRefPtr<WidgetTreeModel> create(GUI::Widget& root) { return adopt(*new WidgetTreeModel(root)); }
@@ -49,3 +51,5 @@ private:
     NonnullRefPtr<GUI::Widget> m_root;
     GUI::Icon m_widget_icon;
 };
+
+}

+ 12 - 1
DevTools/HackStudio/main.cpp

@@ -80,6 +80,10 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
+using namespace HackStudio;
+
+namespace HackStudio {
+
 NonnullRefPtrVector<EditorWrapper> g_all_editor_wrappers;
 RefPtr<EditorWrapper> g_current_editor_wrapper;
 Function<void(String)> g_open_file;
@@ -172,7 +176,7 @@ static String get_project_executable_path()
     return g_project->path().substring(0, g_project->path().index_of(".").value());
 }
 
-int main(int argc, char** argv)
+int main_impl(int argc, char** argv)
 {
     if (pledge("stdio tty accept rpath cpath wpath shared_buffer proc exec unix fattr thread", nullptr) < 0) {
         perror("pledge");
@@ -820,3 +824,10 @@ bool make_is_available()
     posix_spawn_file_actions_destroy(&action);
     return WEXITSTATUS(wstatus) == 0;
 }
+
+}
+
+int main(int argc, char** argv)
+{
+    return main_impl(argc, argv);
+}