diff --git a/Applications/Calculator/CalculatorWidget.h b/Applications/Calculator/CalculatorWidget.h index 59502ed97a..a01b3c4cc2 100644 --- a/Applications/Calculator/CalculatorWidget.h +++ b/Applications/Calculator/CalculatorWidget.h @@ -25,26 +25,26 @@ private: Calculator m_calculator; Keypad m_keypad; - ObjectPtr m_entry; - ObjectPtr m_label; + RefPtr m_entry; + RefPtr m_label; - ObjectPtr m_digit_button[10]; - ObjectPtr m_mem_add_button; - ObjectPtr m_mem_save_button; - ObjectPtr m_mem_recall_button; - ObjectPtr m_mem_clear_button; - ObjectPtr m_clear_button; - ObjectPtr m_clear_error_button; - ObjectPtr m_backspace_button; - ObjectPtr m_decimal_point_button; - ObjectPtr m_sign_button; - ObjectPtr m_add_button; - ObjectPtr m_subtract_button; - ObjectPtr m_multiply_button; - ObjectPtr m_divide_button; - ObjectPtr m_sqrt_button; - ObjectPtr m_inverse_button; - ObjectPtr m_percent_button; - ObjectPtr m_equals_button; + RefPtr m_digit_button[10]; + RefPtr m_mem_add_button; + RefPtr m_mem_save_button; + RefPtr m_mem_recall_button; + RefPtr m_mem_clear_button; + RefPtr m_clear_button; + RefPtr m_clear_error_button; + RefPtr m_backspace_button; + RefPtr m_decimal_point_button; + RefPtr m_sign_button; + RefPtr m_add_button; + RefPtr m_subtract_button; + RefPtr m_multiply_button; + RefPtr m_divide_button; + RefPtr m_sqrt_button; + RefPtr m_inverse_button; + RefPtr m_percent_button; + RefPtr m_equals_button; }; diff --git a/Applications/ChanViewer/BoardListModel.h b/Applications/ChanViewer/BoardListModel.h index 405b8f17dd..584ec413f4 100644 --- a/Applications/ChanViewer/BoardListModel.h +++ b/Applications/ChanViewer/BoardListModel.h @@ -25,5 +25,5 @@ private: BoardListModel(); JsonArray m_boards; - ObjectPtr m_pending_job; + RefPtr m_pending_job; }; diff --git a/Applications/ChanViewer/ThreadCatalogModel.h b/Applications/ChanViewer/ThreadCatalogModel.h index bdf428f58f..d5f3f35875 100644 --- a/Applications/ChanViewer/ThreadCatalogModel.h +++ b/Applications/ChanViewer/ThreadCatalogModel.h @@ -37,5 +37,5 @@ private: String m_board { "g" }; JsonArray m_catalog; - ObjectPtr m_pending_job; + RefPtr m_pending_job; }; diff --git a/Applications/DisplayProperties/DisplayProperties.h b/Applications/DisplayProperties/DisplayProperties.h index ad51f9926a..8cb6033167 100644 --- a/Applications/DisplayProperties/DisplayProperties.h +++ b/Applications/DisplayProperties/DisplayProperties.h @@ -40,10 +40,10 @@ private: private: String m_wallpaper_path; RefPtr m_wm_config; - ObjectPtr m_root_widget; + RefPtr m_root_widget; Vector m_resolutions; Vector m_wallpapers; - ObjectPtr m_wallpaper_preview; + RefPtr m_wallpaper_preview; Size m_selected_resolution; String m_selected_wallpaper; diff --git a/Applications/FileManager/DirectoryView.h b/Applications/FileManager/DirectoryView.h index 53b6eec578..d513c5b201 100644 --- a/Applications/FileManager/DirectoryView.h +++ b/Applications/FileManager/DirectoryView.h @@ -72,6 +72,6 @@ private: Vector m_path_history; void add_path_to_history(const StringView& path); - ObjectPtr m_table_view; - ObjectPtr m_item_view; + RefPtr m_table_view; + RefPtr m_item_view; }; diff --git a/Applications/IRCClient/IRCAppWindow.h b/Applications/IRCClient/IRCAppWindow.h index a058152b84..d990aae6f8 100644 --- a/Applications/IRCClient/IRCAppWindow.h +++ b/Applications/IRCClient/IRCAppWindow.h @@ -27,8 +27,8 @@ private: IRCWindow& create_window(void* owner, IRCWindow::Type, const String& name); IRCClient m_client; - ObjectPtr m_container; - ObjectPtr m_window_list; + RefPtr m_container; + RefPtr m_window_list; RefPtr m_join_action; RefPtr m_part_action; RefPtr m_whois_action; diff --git a/Applications/IRCClient/IRCClient.h b/Applications/IRCClient/IRCClient.h index 75e20e7ae1..ed89e482c2 100644 --- a/Applications/IRCClient/IRCClient.h +++ b/Applications/IRCClient/IRCClient.h @@ -8,7 +8,6 @@ #include #include #include -#include class IRCChannel; class IRCQuery; @@ -137,10 +136,10 @@ private: String m_hostname; int m_port { 6667 }; - ObjectPtr m_socket; + RefPtr m_socket; String m_nickname; - ObjectPtr m_notifier; + RefPtr m_notifier; HashMap, CaseInsensitiveStringTraits> m_channels; HashMap, CaseInsensitiveStringTraits> m_queries; diff --git a/Applications/IRCClient/IRCWindow.h b/Applications/IRCClient/IRCWindow.h index a23d028b9f..62c26fd681 100644 --- a/Applications/IRCClient/IRCWindow.h +++ b/Applications/IRCClient/IRCWindow.h @@ -46,8 +46,8 @@ private: void* m_owner { nullptr }; Type m_type; String m_name; - ObjectPtr m_table_view; - ObjectPtr m_text_editor; + RefPtr m_table_view; + RefPtr m_text_editor; RefPtr m_log_buffer; int m_unread_count { 0 }; }; diff --git a/Applications/Launcher/main.cpp b/Applications/Launcher/main.cpp index 51aea7ea1c..251b8ee701 100644 --- a/Applications/Launcher/main.cpp +++ b/Applications/Launcher/main.cpp @@ -12,7 +12,7 @@ #include #include -static ObjectPtr make_launcher_window(); +static RefPtr make_launcher_window(); void handle_sigchld(int) { @@ -63,7 +63,7 @@ private: String m_executable_path; }; -ObjectPtr make_launcher_window() +RefPtr make_launcher_window() { auto config = CConfigFile::get_for_app("Launcher"); auto vertical = config->read_bool_entry("Launcher", "Vertical", true); diff --git a/Applications/PaintBrush/ColorDialog.h b/Applications/PaintBrush/ColorDialog.h index 40ee1e3c76..31f6e3b1d2 100644 --- a/Applications/PaintBrush/ColorDialog.h +++ b/Applications/PaintBrush/ColorDialog.h @@ -17,5 +17,5 @@ private: void build(); Color m_color; - ObjectPtr m_preview_widget; + RefPtr m_preview_widget; }; diff --git a/Applications/PaintBrush/PaletteWidget.h b/Applications/PaintBrush/PaletteWidget.h index e9e0c5ebbb..a7bce91aee 100644 --- a/Applications/PaintBrush/PaletteWidget.h +++ b/Applications/PaintBrush/PaletteWidget.h @@ -15,6 +15,6 @@ public: private: PaintableWidget& m_paintable_widget; - ObjectPtr m_primary_color_widget; - ObjectPtr m_secondary_color_widget; + RefPtr m_primary_color_widget; + RefPtr m_secondary_color_widget; }; diff --git a/Applications/PaintBrush/SprayTool.h b/Applications/PaintBrush/SprayTool.h index 679009a1da..7f75da7dcc 100644 --- a/Applications/PaintBrush/SprayTool.h +++ b/Applications/PaintBrush/SprayTool.h @@ -19,7 +19,7 @@ public: private: virtual const char* class_name() const override { return "SprayTool"; } void paint_it(); - ObjectPtr m_timer; + RefPtr m_timer; Point m_last_pos; Color m_color; OwnPtr m_context_menu; diff --git a/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Applications/SystemMonitor/MemoryStatsWidget.cpp index 1c0594591c..002993c194 100644 --- a/Applications/SystemMonitor/MemoryStatsWidget.cpp +++ b/Applications/SystemMonitor/MemoryStatsWidget.cpp @@ -22,7 +22,7 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph, GWidget* parent) layout()->set_margins({ 0, 8, 0, 0 }); layout()->set_spacing(3); - auto build_widgets_for_label = [this](const String& description) -> ObjectPtr { + auto build_widgets_for_label = [this](const String& description) -> RefPtr { auto container = GWidget::construct(this); container->set_layout(make(Orientation::Horizontal)); container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); diff --git a/Applications/SystemMonitor/MemoryStatsWidget.h b/Applications/SystemMonitor/MemoryStatsWidget.h index 32b5f27bf6..d63f338836 100644 --- a/Applications/SystemMonitor/MemoryStatsWidget.h +++ b/Applications/SystemMonitor/MemoryStatsWidget.h @@ -18,9 +18,9 @@ private: virtual void timer_event(CTimerEvent&) override; GraphWidget& m_graph; - ObjectPtr m_user_physical_pages_label; - ObjectPtr m_supervisor_physical_pages_label; - ObjectPtr m_kmalloc_label; - ObjectPtr m_kmalloc_count_label; - ObjectPtr m_proc_memstat; + RefPtr m_user_physical_pages_label; + RefPtr m_supervisor_physical_pages_label; + RefPtr m_kmalloc_label; + RefPtr m_kmalloc_count_label; + RefPtr m_proc_memstat; }; diff --git a/Applications/SystemMonitor/NetworkStatisticsWidget.h b/Applications/SystemMonitor/NetworkStatisticsWidget.h index 018ad0d955..f383289cc2 100644 --- a/Applications/SystemMonitor/NetworkStatisticsWidget.h +++ b/Applications/SystemMonitor/NetworkStatisticsWidget.h @@ -14,7 +14,7 @@ private: explicit NetworkStatisticsWidget(GWidget* parent = nullptr); void update_models(); - ObjectPtr m_adapter_table_view; - ObjectPtr m_socket_table_view; - ObjectPtr m_update_timer; + RefPtr m_adapter_table_view; + RefPtr m_socket_table_view; + RefPtr m_update_timer; }; diff --git a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.h b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.h index 4bc8f3434f..bc5f090b12 100644 --- a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.h +++ b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.h @@ -14,6 +14,6 @@ public: private: explicit ProcessFileDescriptorMapWidget(GWidget* parent); - ObjectPtr m_table_view; + RefPtr m_table_view; pid_t m_pid { -1 }; }; diff --git a/Applications/SystemMonitor/ProcessMemoryMapWidget.h b/Applications/SystemMonitor/ProcessMemoryMapWidget.h index 7ee769f96e..db09ddc454 100644 --- a/Applications/SystemMonitor/ProcessMemoryMapWidget.h +++ b/Applications/SystemMonitor/ProcessMemoryMapWidget.h @@ -13,6 +13,6 @@ public: private: explicit ProcessMemoryMapWidget(GWidget* parent); - ObjectPtr m_table_view; + RefPtr m_table_view; pid_t m_pid { -1 }; }; diff --git a/Applications/SystemMonitor/ProcessStacksWidget.h b/Applications/SystemMonitor/ProcessStacksWidget.h index 1779d1498d..598c8a7b69 100644 --- a/Applications/SystemMonitor/ProcessStacksWidget.h +++ b/Applications/SystemMonitor/ProcessStacksWidget.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include @@ -17,6 +16,6 @@ public: private: pid_t m_pid { -1 }; - ObjectPtr m_stacks_editor; - ObjectPtr m_timer; + RefPtr m_stacks_editor; + RefPtr m_timer; }; diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index af6d685267..36a53cbb1b 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -39,9 +39,9 @@ static String human_readable_size(u32 size) return String::format("%u GB", size / GB); } -static ObjectPtr build_file_systems_tab(); -static ObjectPtr build_pci_devices_tab(); -static ObjectPtr build_devices_tab(); +static RefPtr build_file_systems_tab(); +static RefPtr build_pci_devices_tab(); +static RefPtr build_devices_tab(); int main(int argc, char** argv) { @@ -234,7 +234,7 @@ public: } }; -ObjectPtr build_file_systems_tab() +RefPtr build_file_systems_tab() { auto fs_widget = GWidget::construct(); fs_widget->set_layout(make(Orientation::Vertical)); @@ -299,7 +299,7 @@ ObjectPtr build_file_systems_tab() return fs_widget; } -ObjectPtr build_pci_devices_tab() +RefPtr build_pci_devices_tab() { auto pci_widget = GWidget::construct(); pci_widget->set_layout(make(Orientation::Vertical)); @@ -353,7 +353,7 @@ ObjectPtr build_pci_devices_tab() return pci_widget; } -ObjectPtr build_devices_tab() +RefPtr build_devices_tab() { auto devices_widget = GWidget::construct(); devices_widget->set_layout(make(Orientation::Vertical)); diff --git a/Applications/Terminal/TerminalWidget.h b/Applications/Terminal/TerminalWidget.h index d1a2f4321a..9f8ca2eed6 100644 --- a/Applications/Terminal/TerminalWidget.h +++ b/Applications/Terminal/TerminalWidget.h @@ -88,7 +88,7 @@ private: bool m_in_active_window { false }; - ObjectPtr m_notifier; + RefPtr m_notifier; u8 m_opacity { 255 }; bool m_needs_background_fill { true }; @@ -96,9 +96,9 @@ private: int m_glyph_width { 0 }; - ObjectPtr m_cursor_blink_timer; - ObjectPtr m_visual_beep_timer; + RefPtr m_cursor_blink_timer; + RefPtr m_visual_beep_timer; RefPtr m_config; - ObjectPtr m_scrollbar; + RefPtr m_scrollbar; }; diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index 9e46463a39..4b5082249b 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -88,7 +88,7 @@ static void run_command(int ptm_fd, String command) } } -ObjectPtr create_settings_window(TerminalWidget& terminal, RefPtr config) +RefPtr create_settings_window(TerminalWidget& terminal, RefPtr config) { auto window = GWindow::construct(); window->set_title("Terminal Settings"); @@ -170,7 +170,7 @@ int main(int argc, char** argv) window->set_icon(load_png("/res/icons/16x16/app-terminal.png")); terminal->set_should_beep(config->read_bool_entry("Window", "AudibleBeep", false)); - ObjectPtr settings_window; + RefPtr settings_window; auto new_opacity = config->read_num_entry("Window", "Opacity", 255); terminal->set_opacity(new_opacity); diff --git a/Applications/TextEditor/TextEditorWidget.h b/Applications/TextEditor/TextEditorWidget.h index 12b29876cb..208b965931 100644 --- a/Applications/TextEditor/TextEditorWidget.h +++ b/Applications/TextEditor/TextEditorWidget.h @@ -24,7 +24,7 @@ private: void set_path(const FileSystemPath& file); void update_title(); - ObjectPtr m_editor; + RefPtr m_editor; String m_path; String m_name; String m_extension; @@ -37,12 +37,12 @@ private: RefPtr m_find_next_action; RefPtr m_find_previous_action; - ObjectPtr m_statusbar; + RefPtr m_statusbar; - ObjectPtr m_find_textbox; + RefPtr m_find_textbox; GButton* m_find_previous_button { nullptr }; GButton* m_find_next_button { nullptr }; - ObjectPtr m_find_widget; + RefPtr m_find_widget; bool m_document_dirty { false }; }; diff --git a/DevTools/FormCompiler/main.cpp b/DevTools/FormCompiler/main.cpp index 0b4dfafe39..716e0cc7d5 100644 --- a/DevTools/FormCompiler/main.cpp +++ b/DevTools/FormCompiler/main.cpp @@ -44,14 +44,14 @@ int main(int argc, char** argv) }); dbg() << "struct UI_" << name << " {"; - dbg() << " ObjectPtr main_widget;"; + dbg() << " RefPtr main_widget;"; widgets.as_array().for_each([&](auto& value) { ASSERT(value.is_object()); const JsonObject& widget_object = value.as_object(); auto name = widget_object.get("name").to_string(); auto class_name = widget_object.get("class").to_string(); - dbg() << " ObjectPtr<" << class_name << "> " << name << ";"; + dbg() << " RefPtr<" << class_name << "> " << name << ";"; }); dbg() << " UI_" << name << "();"; diff --git a/DevTools/Inspector/RemoteProcess.h b/DevTools/Inspector/RemoteProcess.h index 8640631b60..26ef7f5f58 100644 --- a/DevTools/Inspector/RemoteProcess.h +++ b/DevTools/Inspector/RemoteProcess.h @@ -32,6 +32,6 @@ private: pid_t m_pid { -1 }; String m_process_name; NonnullRefPtr m_object_graph_model; - ObjectPtr m_socket; + RefPtr m_socket; NonnullOwnPtrVector m_roots; }; diff --git a/DevTools/VisualBuilder/VBPropertiesWindow.cpp b/DevTools/VisualBuilder/VBPropertiesWindow.cpp index 76622fd4d8..fb56008575 100644 --- a/DevTools/VisualBuilder/VBPropertiesWindow.cpp +++ b/DevTools/VisualBuilder/VBPropertiesWindow.cpp @@ -31,7 +31,7 @@ public: BoolModelEditingDelegate() {} virtual ~BoolModelEditingDelegate() override {} - virtual ObjectPtr create_widget() override + virtual RefPtr create_widget() override { auto combo = GComboBox::construct(nullptr); combo->set_only_allow_values_from_model(true); diff --git a/DevTools/VisualBuilder/VBPropertiesWindow.h b/DevTools/VisualBuilder/VBPropertiesWindow.h index eb1b17530b..8ff0b78ccf 100644 --- a/DevTools/VisualBuilder/VBPropertiesWindow.h +++ b/DevTools/VisualBuilder/VBPropertiesWindow.h @@ -15,5 +15,5 @@ public: const GTableView& table_view() const { return *m_table_view; } private: - ObjectPtr m_table_view; + RefPtr m_table_view; }; diff --git a/DevTools/VisualBuilder/VBWidget.h b/DevTools/VisualBuilder/VBWidget.h index 735e532afa..4408959267 100644 --- a/DevTools/VisualBuilder/VBWidget.h +++ b/DevTools/VisualBuilder/VBWidget.h @@ -81,7 +81,7 @@ private: VBWidgetType m_type { VBWidgetType::None }; VBForm& m_form; - ObjectPtr m_gwidget; + RefPtr m_gwidget; NonnullOwnPtrVector m_properties; NonnullRefPtr m_property_model; Rect m_transform_origin_rect; diff --git a/DevTools/VisualBuilder/VBWidgetRegistry.cpp b/DevTools/VisualBuilder/VBWidgetRegistry.cpp index e9642adcfd..3c7dcbc145 100644 --- a/DevTools/VisualBuilder/VBWidgetRegistry.cpp +++ b/DevTools/VisualBuilder/VBWidgetRegistry.cpp @@ -68,7 +68,7 @@ VBWidgetType widget_type_from_class_name(const StringView& name) ASSERT_NOT_REACHED(); } -static ObjectPtr build_gwidget(VBWidgetType type, GWidget* parent) +static RefPtr build_gwidget(VBWidgetType type, GWidget* parent) { switch (type) { case VBWidgetType::GWidget: @@ -125,7 +125,7 @@ static ObjectPtr build_gwidget(VBWidgetType type, GWidget* parent) } } -ObjectPtr VBWidgetRegistry::build_gwidget(VBWidget& widget, VBWidgetType type, GWidget* parent, NonnullOwnPtrVector& properties) +RefPtr VBWidgetRegistry::build_gwidget(VBWidget& widget, VBWidgetType type, GWidget* parent, NonnullOwnPtrVector& properties) { auto gwidget = ::build_gwidget(type, parent); auto add_readonly_property = [&](const String& name, const GVariant& value) { diff --git a/DevTools/VisualBuilder/VBWidgetRegistry.h b/DevTools/VisualBuilder/VBWidgetRegistry.h index 93f1fb091b..9bd8014165 100644 --- a/DevTools/VisualBuilder/VBWidgetRegistry.h +++ b/DevTools/VisualBuilder/VBWidgetRegistry.h @@ -19,7 +19,7 @@ public: callback((VBWidgetType)i); } - static ObjectPtr build_gwidget(VBWidget&, VBWidgetType, GWidget* parent, NonnullOwnPtrVector&); + static RefPtr build_gwidget(VBWidget&, VBWidgetType, GWidget* parent, NonnullOwnPtrVector&); }; String to_class_name(VBWidgetType); diff --git a/DevTools/VisualBuilder/main.cpp b/DevTools/VisualBuilder/main.cpp index c93a5527c4..3d96db1e51 100644 --- a/DevTools/VisualBuilder/main.cpp +++ b/DevTools/VisualBuilder/main.cpp @@ -17,7 +17,7 @@ #include #include -static ObjectPtr make_toolbox_window(); +static RefPtr make_toolbox_window(); int main(int argc, char** argv) { @@ -74,7 +74,7 @@ int main(int argc, char** argv) return app.exec(); } -ObjectPtr make_toolbox_window() +RefPtr make_toolbox_window() { auto window = GWindow::construct(); window->set_title("Widgets"); diff --git a/Games/Minesweeper/Field.h b/Games/Minesweeper/Field.h index fff4cb0161..e5e04af682 100644 --- a/Games/Minesweeper/Field.h +++ b/Games/Minesweeper/Field.h @@ -95,7 +95,7 @@ private: GButton& m_face_button; GLabel& m_flag_label; GLabel& m_time_label; - ObjectPtr m_timer; + RefPtr m_timer; int m_time_elapsed { 0 }; int m_flags_left { 0 }; Face m_face { Face::Default }; diff --git a/Libraries/LibAudio/AWavLoader.h b/Libraries/LibAudio/AWavLoader.h index ac18e58ba2..494649b7a6 100644 --- a/Libraries/LibAudio/AWavLoader.h +++ b/Libraries/LibAudio/AWavLoader.h @@ -29,7 +29,7 @@ public: private: bool parse_header(); - ObjectPtr m_file; + RefPtr m_file; String m_error_string; u32 m_sample_rate { 0 }; diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp index df05f95784..68ef3bd753 100644 --- a/Libraries/LibCore/CEventLoop.cpp +++ b/Libraries/LibCore/CEventLoop.cpp @@ -29,12 +29,12 @@ HashMap>* CEventLoop::s_timers; HashTable* CEventLoop::s_notifiers; int CEventLoop::s_next_timer_id = 1; int CEventLoop::s_wake_pipe_fds[2]; -ObjectPtr CEventLoop::s_rpc_server; +RefPtr CEventLoop::s_rpc_server; class RPCClient : public CObject { C_OBJECT(RPCClient) public: - explicit RPCClient(ObjectPtr socket) + explicit RPCClient(RefPtr socket) : m_socket(move(socket)) { add_child(*m_socket); @@ -123,7 +123,7 @@ public: } private: - ObjectPtr m_socket; + RefPtr m_socket; }; CEventLoop::CEventLoop() diff --git a/Libraries/LibCore/CEventLoop.h b/Libraries/LibCore/CEventLoop.h index 6ec33fd715..16538e2c48 100644 --- a/Libraries/LibCore/CEventLoop.h +++ b/Libraries/LibCore/CEventLoop.h @@ -87,5 +87,5 @@ private: static HashTable* s_notifiers; - static ObjectPtr s_rpc_server; + static RefPtr s_rpc_server; }; diff --git a/Libraries/LibCore/CHttpJob.h b/Libraries/LibCore/CHttpJob.h index 3e3b758977..cb0e00506c 100644 --- a/Libraries/LibCore/CHttpJob.h +++ b/Libraries/LibCore/CHttpJob.h @@ -27,7 +27,7 @@ private: }; CHttpRequest m_request; - ObjectPtr m_socket; + RefPtr m_socket; State m_state { State::InStatus }; int m_code { -1 }; HashMap m_headers; diff --git a/Libraries/LibCore/CHttpRequest.cpp b/Libraries/LibCore/CHttpRequest.cpp index 4092249f0d..17537a3244 100644 --- a/Libraries/LibCore/CHttpRequest.cpp +++ b/Libraries/LibCore/CHttpRequest.cpp @@ -10,7 +10,7 @@ CHttpRequest::~CHttpRequest() { } -ObjectPtr CHttpRequest::schedule() +RefPtr CHttpRequest::schedule() { auto job = CHttpJob::construct(*this); job->start(); diff --git a/Libraries/LibCore/CHttpRequest.h b/Libraries/LibCore/CHttpRequest.h index 6d0d3a6259..0d73383e8c 100644 --- a/Libraries/LibCore/CHttpRequest.h +++ b/Libraries/LibCore/CHttpRequest.h @@ -2,7 +2,6 @@ #include #include -#include class CNetworkJob; @@ -27,7 +26,7 @@ public: String method_name() const; ByteBuffer to_raw_request() const; - ObjectPtr schedule(); + RefPtr schedule(); private: URL m_url; diff --git a/Libraries/LibCore/CLocalServer.cpp b/Libraries/LibCore/CLocalServer.cpp index b70d31fd1a..b68c5381f1 100644 --- a/Libraries/LibCore/CLocalServer.cpp +++ b/Libraries/LibCore/CLocalServer.cpp @@ -39,7 +39,7 @@ bool CLocalServer::listen(const String& address) return true; } -ObjectPtr CLocalServer::accept() +RefPtr CLocalServer::accept() { ASSERT(m_listening); sockaddr_un un; diff --git a/Libraries/LibCore/CLocalServer.h b/Libraries/LibCore/CLocalServer.h index ca2b1099da..1e512728d8 100644 --- a/Libraries/LibCore/CLocalServer.h +++ b/Libraries/LibCore/CLocalServer.h @@ -13,7 +13,7 @@ public: bool is_listening() const { return m_listening; } bool listen(const String& address); - ObjectPtr accept(); + RefPtr accept(); Function on_ready_to_accept; @@ -22,5 +22,5 @@ private: int m_fd { -1 }; bool m_listening { false }; - ObjectPtr m_notifier; + RefPtr m_notifier; }; diff --git a/Libraries/LibCore/CNotifier.h b/Libraries/LibCore/CNotifier.h index f724a588b5..bd9d407425 100644 --- a/Libraries/LibCore/CNotifier.h +++ b/Libraries/LibCore/CNotifier.h @@ -2,7 +2,6 @@ #include #include -#include class CNotifier : public CObject { C_OBJECT(CNotifier) diff --git a/Libraries/LibCore/CObject.h b/Libraries/LibCore/CObject.h index 1c182a322f..dd036ef666 100644 --- a/Libraries/LibCore/CObject.h +++ b/Libraries/LibCore/CObject.h @@ -8,7 +8,6 @@ #include #include #include -#include namespace AK { class JsonObject; diff --git a/Libraries/LibCore/CSocket.h b/Libraries/LibCore/CSocket.h index a6c2ef454c..563c7b5586 100644 --- a/Libraries/LibCore/CSocket.h +++ b/Libraries/LibCore/CSocket.h @@ -2,7 +2,6 @@ #include #include -#include class CNotifier; @@ -54,6 +53,6 @@ private: bool common_connect(const struct sockaddr*, socklen_t); Type m_type { Type::Invalid }; - ObjectPtr m_notifier; - ObjectPtr m_read_notifier; + RefPtr m_notifier; + RefPtr m_read_notifier; }; diff --git a/Libraries/LibCore/CTCPServer.cpp b/Libraries/LibCore/CTCPServer.cpp index 2091ee0b7f..f0705b7c0b 100644 --- a/Libraries/LibCore/CTCPServer.cpp +++ b/Libraries/LibCore/CTCPServer.cpp @@ -40,7 +40,7 @@ bool CTCPServer::listen(const IPv4Address& address, u16 port) return true; } -ObjectPtr CTCPServer::accept() +RefPtr CTCPServer::accept() { ASSERT(m_listening); sockaddr_in in; diff --git a/Libraries/LibCore/CTCPServer.h b/Libraries/LibCore/CTCPServer.h index a88960c94f..8e2b6920eb 100644 --- a/Libraries/LibCore/CTCPServer.h +++ b/Libraries/LibCore/CTCPServer.h @@ -14,7 +14,7 @@ public: bool is_listening() const { return m_listening; } bool listen(const IPv4Address& address, u16 port); - ObjectPtr accept(); + RefPtr accept(); Function on_ready_to_accept; @@ -23,5 +23,5 @@ private: int m_fd { -1 }; bool m_listening { false }; - ObjectPtr m_notifier; + RefPtr m_notifier; }; diff --git a/Libraries/LibCore/CTimer.h b/Libraries/LibCore/CTimer.h index 2df70ee5d3..a22b725d21 100644 --- a/Libraries/LibCore/CTimer.h +++ b/Libraries/LibCore/CTimer.h @@ -2,7 +2,6 @@ #include #include -#include class CTimer final : public CObject { C_OBJECT(CTimer) diff --git a/Libraries/LibCore/CoreIPCClient.h b/Libraries/LibCore/CoreIPCClient.h index 5845b8b1c9..a16ca22821 100644 --- a/Libraries/LibCore/CoreIPCClient.h +++ b/Libraries/LibCore/CoreIPCClient.h @@ -229,8 +229,8 @@ namespace Client { } } - ObjectPtr m_connection; - ObjectPtr m_notifier; + RefPtr m_connection; + RefPtr m_notifier; Vector m_unprocessed_bundles; int m_server_pid { -1 }; int m_my_client_id { -1 }; @@ -372,8 +372,8 @@ namespace Client { } } - ObjectPtr m_connection; - ObjectPtr m_notifier; + RefPtr m_connection; + RefPtr m_notifier; Vector> m_unprocessed_messages; int m_server_pid { -1 }; int m_my_client_id { -1 }; diff --git a/Libraries/LibCore/CoreIPCServer.h b/Libraries/LibCore/CoreIPCServer.h index f8c064e8fa..73b3130379 100644 --- a/Libraries/LibCore/CoreIPCServer.h +++ b/Libraries/LibCore/CoreIPCServer.h @@ -203,7 +203,7 @@ namespace Server { virtual bool handle_message(const ClientMessage&, const ByteBuffer&& = {}) = 0; private: - ObjectPtr m_socket; + RefPtr m_socket; int m_client_id { -1 }; int m_client_pid { -1 }; }; @@ -311,7 +311,7 @@ namespace Server { private: Endpoint& m_endpoint; - ObjectPtr m_socket; + RefPtr m_socket; int m_client_id { -1 }; int m_client_pid { -1 }; }; diff --git a/Libraries/LibCore/ObjectPtr.h b/Libraries/LibCore/ObjectPtr.h deleted file mode 100644 index 8490a8877e..0000000000 --- a/Libraries/LibCore/ObjectPtr.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#define ObjectPtr RefPtr diff --git a/Libraries/LibGUI/GAbstractButton.h b/Libraries/LibGUI/GAbstractButton.h index 266cff6b4b..163ae89670 100644 --- a/Libraries/LibGUI/GAbstractButton.h +++ b/Libraries/LibGUI/GAbstractButton.h @@ -61,7 +61,7 @@ private: bool m_exclusive { false }; int m_auto_repeat_interval { 0 }; - ObjectPtr m_auto_repeat_timer; + RefPtr m_auto_repeat_timer; }; template<> diff --git a/Libraries/LibGUI/GAbstractView.h b/Libraries/LibGUI/GAbstractView.h index 444d7acc4e..95d6520cde 100644 --- a/Libraries/LibGUI/GAbstractView.h +++ b/Libraries/LibGUI/GAbstractView.h @@ -52,7 +52,7 @@ protected: bool m_editable { false }; GModelIndex m_edit_index; - ObjectPtr m_edit_widget; + RefPtr m_edit_widget; Rect m_edit_widget_content_rect; private: diff --git a/Libraries/LibGUI/GApplication.cpp b/Libraries/LibGUI/GApplication.cpp index 1c404225c9..ca2c0b061d 100644 --- a/Libraries/LibGUI/GApplication.cpp +++ b/Libraries/LibGUI/GApplication.cpp @@ -92,7 +92,7 @@ public: m_label->set_text(tooltip); } - ObjectPtr m_label; + RefPtr m_label; }; void GApplication::show_tooltip(const StringView& tooltip, const Point& screen_location) diff --git a/Libraries/LibGUI/GComboBox.h b/Libraries/LibGUI/GComboBox.h index 7a3a3bf579..ef9ceb4d07 100644 --- a/Libraries/LibGUI/GComboBox.h +++ b/Libraries/LibGUI/GComboBox.h @@ -36,9 +36,9 @@ protected: virtual void resize_event(GResizeEvent&) override; private: - ObjectPtr m_editor; - ObjectPtr m_open_button; - ObjectPtr m_list_window; - ObjectPtr m_list_view; + RefPtr m_editor; + RefPtr m_open_button; + RefPtr m_list_window; + RefPtr m_list_view; bool m_only_allow_values_from_model { false }; }; diff --git a/Libraries/LibGUI/GDirectoryModel.h b/Libraries/LibGUI/GDirectoryModel.h index 0a08fd291f..2102bebb6f 100644 --- a/Libraries/LibGUI/GDirectoryModel.h +++ b/Libraries/LibGUI/GDirectoryModel.h @@ -82,7 +82,7 @@ private: HashMap m_user_names; HashMap m_group_names; - ObjectPtr m_notifier; + RefPtr m_notifier; unsigned m_thumbnail_progress { 0 }; unsigned m_thumbnail_progress_total { 0 }; diff --git a/Libraries/LibGUI/GFilePicker.h b/Libraries/LibGUI/GFilePicker.h index f7862161a2..07cb0fe4b7 100644 --- a/Libraries/LibGUI/GFilePicker.h +++ b/Libraries/LibGUI/GFilePicker.h @@ -42,13 +42,13 @@ private: } } - ObjectPtr m_view; + RefPtr m_view; NonnullRefPtr m_model; FileSystemPath m_selected_file; - ObjectPtr m_filename_textbox; - ObjectPtr m_preview_image_label; - ObjectPtr m_preview_name_label; - ObjectPtr m_preview_geometry_label; + RefPtr m_filename_textbox; + RefPtr m_preview_image_label; + RefPtr m_preview_name_label; + RefPtr m_preview_geometry_label; Mode m_mode { Mode::Open }; }; diff --git a/Libraries/LibGUI/GInputBox.h b/Libraries/LibGUI/GInputBox.h index 91c518b0f0..c25caaff29 100644 --- a/Libraries/LibGUI/GInputBox.h +++ b/Libraries/LibGUI/GInputBox.h @@ -18,7 +18,7 @@ private: String m_prompt; String m_text_value; - ObjectPtr m_ok_button; - ObjectPtr m_cancel_button; - ObjectPtr m_text_editor; + RefPtr m_ok_button; + RefPtr m_cancel_button; + RefPtr m_text_editor; }; diff --git a/Libraries/LibGUI/GMessageBox.cpp b/Libraries/LibGUI/GMessageBox.cpp index d59c03bd25..1ffe9329c5 100644 --- a/Libraries/LibGUI/GMessageBox.cpp +++ b/Libraries/LibGUI/GMessageBox.cpp @@ -62,7 +62,7 @@ void GMessageBox::build() widget->layout()->set_margins({ 0, 15, 0, 15 }); widget->layout()->set_spacing(15); - ObjectPtr message_container = widget; + RefPtr message_container = widget; if (m_type != Type::None) { message_container = GWidget::construct(widget.ptr()); message_container->set_layout(make(Orientation::Horizontal)); diff --git a/Libraries/LibGUI/GModelEditingDelegate.h b/Libraries/LibGUI/GModelEditingDelegate.h index 7214f9d1b6..8403fead8b 100644 --- a/Libraries/LibGUI/GModelEditingDelegate.h +++ b/Libraries/LibGUI/GModelEditingDelegate.h @@ -29,7 +29,7 @@ public: virtual void will_begin_editing() { } protected: - virtual ObjectPtr create_widget() = 0; + virtual RefPtr create_widget() = 0; void commit() { if (on_commit) @@ -39,7 +39,7 @@ protected: private: RefPtr m_model; GModelIndex m_index; - ObjectPtr m_widget; + RefPtr m_widget; }; class GStringModelEditingDelegate : public GModelEditingDelegate { @@ -47,7 +47,7 @@ public: GStringModelEditingDelegate() {} virtual ~GStringModelEditingDelegate() override {} - virtual ObjectPtr create_widget() override + virtual RefPtr create_widget() override { auto textbox = GTextBox::construct(nullptr); textbox->on_return_pressed = [this] { diff --git a/Libraries/LibGUI/GScrollBar.h b/Libraries/LibGUI/GScrollBar.h index e5d70ce68e..4a3ba0b908 100644 --- a/Libraries/LibGUI/GScrollBar.h +++ b/Libraries/LibGUI/GScrollBar.h @@ -83,5 +83,5 @@ private: }; AutomaticScrollingDirection m_automatic_scrolling_direction { AutomaticScrollingDirection::None }; - ObjectPtr m_automatic_scrolling_timer; + RefPtr m_automatic_scrolling_timer; }; diff --git a/Libraries/LibGUI/GScrollableWidget.h b/Libraries/LibGUI/GScrollableWidget.h index c42dcfc2e0..dbef80042a 100644 --- a/Libraries/LibGUI/GScrollableWidget.h +++ b/Libraries/LibGUI/GScrollableWidget.h @@ -53,9 +53,9 @@ protected: private: void update_scrollbar_ranges(); - ObjectPtr m_vertical_scrollbar; - ObjectPtr m_horizontal_scrollbar; - ObjectPtr m_corner_widget; + RefPtr m_vertical_scrollbar; + RefPtr m_horizontal_scrollbar; + RefPtr m_corner_widget; Size m_content_size; Size m_size_occupied_by_fixed_elements; bool m_scrollbars_enabled { true }; diff --git a/Libraries/LibGUI/GSpinBox.h b/Libraries/LibGUI/GSpinBox.h index 30d9874911..7add914a62 100644 --- a/Libraries/LibGUI/GSpinBox.h +++ b/Libraries/LibGUI/GSpinBox.h @@ -27,9 +27,9 @@ protected: virtual void resize_event(GResizeEvent&) override; private: - ObjectPtr m_editor; - ObjectPtr m_increment_button; - ObjectPtr m_decrement_button; + RefPtr m_editor; + RefPtr m_increment_button; + RefPtr m_decrement_button; int m_min { 0 }; int m_max { 100 }; diff --git a/Libraries/LibGUI/GStackWidget.h b/Libraries/LibGUI/GStackWidget.h index c2597c83ae..536d64b61d 100644 --- a/Libraries/LibGUI/GStackWidget.h +++ b/Libraries/LibGUI/GStackWidget.h @@ -19,5 +19,5 @@ protected: virtual void resize_event(GResizeEvent&) override; private: - ObjectPtr m_active_widget; + RefPtr m_active_widget; }; diff --git a/Libraries/LibGUI/GStatusBar.h b/Libraries/LibGUI/GStatusBar.h index 39ecc812ff..4f687192e6 100644 --- a/Libraries/LibGUI/GStatusBar.h +++ b/Libraries/LibGUI/GStatusBar.h @@ -18,6 +18,6 @@ protected: virtual void paint_event(GPaintEvent&) override; private: - ObjectPtr m_label; - ObjectPtr m_corner; + RefPtr m_label; + RefPtr m_corner; }; diff --git a/Libraries/LibGUI/GTabWidget.h b/Libraries/LibGUI/GTabWidget.h index 46a042c06b..6ec844c7e1 100644 --- a/Libraries/LibGUI/GTabWidget.h +++ b/Libraries/LibGUI/GTabWidget.h @@ -42,7 +42,7 @@ private: Rect container_rect() const; void update_bar(); - ObjectPtr m_active_widget; + RefPtr m_active_widget; struct TabData { Rect rect(const Font&) const; diff --git a/Libraries/LibGUI/GWindow.h b/Libraries/LibGUI/GWindow.h index abbe7a1de6..ea477939e7 100644 --- a/Libraries/LibGUI/GWindow.h +++ b/Libraries/LibGUI/GWindow.h @@ -151,7 +151,7 @@ private: RefPtr m_icon; int m_window_id { 0 }; float m_opacity_when_windowless { 1.0f }; - ObjectPtr m_main_widget; + RefPtr m_main_widget; WeakPtr m_focused_widget; WeakPtr m_global_cursor_tracking_widget; WeakPtr m_automatic_cursor_tracking_widget; diff --git a/Servers/AudioServer/ASEventLoop.h b/Servers/AudioServer/ASEventLoop.h index a9126353c7..b531b98c07 100644 --- a/Servers/AudioServer/ASEventLoop.h +++ b/Servers/AudioServer/ASEventLoop.h @@ -12,6 +12,6 @@ public: private: CEventLoop m_event_loop; - ObjectPtr m_server; + RefPtr m_server; ASMixer m_mixer; }; diff --git a/Servers/AudioServer/ASMixer.h b/Servers/AudioServer/ASMixer.h index 9dfa618217..9286ae3753 100644 --- a/Servers/AudioServer/ASMixer.h +++ b/Servers/AudioServer/ASMixer.h @@ -63,7 +63,7 @@ public: private: Vector> m_pending_mixing; - ObjectPtr m_device; + RefPtr m_device; LibThread::Lock m_lock; LibThread::Thread m_sound_thread; diff --git a/Servers/TelnetServer/Client.cpp b/Servers/TelnetServer/Client.cpp index 5130ca7371..fc0498a753 100644 --- a/Servers/TelnetServer/Client.cpp +++ b/Servers/TelnetServer/Client.cpp @@ -10,7 +10,7 @@ #include "Client.h" -Client::Client(int id, ObjectPtr socket, int ptm_fd) +Client::Client(int id, RefPtr socket, int ptm_fd) : m_id(id) , m_socket(move(socket)) , m_ptm_fd(ptm_fd) diff --git a/Servers/TelnetServer/Client.h b/Servers/TelnetServer/Client.h index 83e9ec32f9..9edc0b845a 100644 --- a/Servers/TelnetServer/Client.h +++ b/Servers/TelnetServer/Client.h @@ -11,7 +11,7 @@ class Client : public RefCounted { public: - static NonnullRefPtr create(int id, ObjectPtr socket, int ptm_fd) + static NonnullRefPtr create(int id, RefPtr socket, int ptm_fd) { return adopt(*new Client(id, move(socket), ptm_fd)); } @@ -19,7 +19,7 @@ public: Function on_exit; protected: - Client(int id, ObjectPtr socket, int ptm_fd); + Client(int id, RefPtr socket, int ptm_fd); void drain_socket(); void drain_pty(); @@ -35,9 +35,9 @@ private: // client id int m_id { 0 }; // client resources - ObjectPtr m_socket; + RefPtr m_socket; Parser m_parser; // pty resources int m_ptm_fd { -1 }; - ObjectPtr m_ptm_notifier; + RefPtr m_ptm_notifier; }; diff --git a/Servers/WindowServer/WSCompositor.h b/Servers/WindowServer/WSCompositor.h index 7e82bd5a7b..4856108fa8 100644 --- a/Servers/WindowServer/WSCompositor.h +++ b/Servers/WindowServer/WSCompositor.h @@ -46,8 +46,8 @@ private: unsigned m_compose_count { 0 }; unsigned m_flush_count { 0 }; - ObjectPtr m_compose_timer; - ObjectPtr m_immediate_compose_timer; + RefPtr m_compose_timer; + RefPtr m_immediate_compose_timer; bool m_flash_flush { false }; bool m_buffers_are_flipped { false }; bool m_screen_can_set_buffer { false }; diff --git a/Servers/WindowServer/WSEventLoop.h b/Servers/WindowServer/WSEventLoop.h index 9bc0bd0e65..7d13f45502 100644 --- a/Servers/WindowServer/WSEventLoop.h +++ b/Servers/WindowServer/WSEventLoop.h @@ -21,8 +21,8 @@ private: CEventLoop m_event_loop; int m_keyboard_fd { -1 }; - ObjectPtr m_keyboard_notifier; + RefPtr m_keyboard_notifier; int m_mouse_fd { -1 }; - ObjectPtr m_mouse_notifier; - ObjectPtr m_server; + RefPtr m_mouse_notifier; + RefPtr m_server; }; diff --git a/Servers/WindowServer/WSMenuManager.h b/Servers/WindowServer/WSMenuManager.h index 93ec1fb851..3d3481909d 100644 --- a/Servers/WindowServer/WSMenuManager.h +++ b/Servers/WindowServer/WSMenuManager.h @@ -33,7 +33,7 @@ private: RefPtr m_window; WSCPUMonitor m_cpu_monitor; String m_username; - ObjectPtr m_timer; + RefPtr m_timer; Vector> m_open_menu_stack; };