mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:37:45 +00:00
LibCore: Remove ObjectPtr in favor of RefPtr
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
This commit is contained in:
parent
bc319d9e88
commit
d6abfbdc5a
71 changed files with 146 additions and 156 deletions
|
@ -61,7 +61,7 @@ private:
|
|||
bool m_exclusive { false };
|
||||
|
||||
int m_auto_repeat_interval { 0 };
|
||||
ObjectPtr<CTimer> m_auto_repeat_timer;
|
||||
RefPtr<CTimer> m_auto_repeat_timer;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
@ -52,7 +52,7 @@ protected:
|
|||
|
||||
bool m_editable { false };
|
||||
GModelIndex m_edit_index;
|
||||
ObjectPtr<GWidget> m_edit_widget;
|
||||
RefPtr<GWidget> m_edit_widget;
|
||||
Rect m_edit_widget_content_rect;
|
||||
|
||||
private:
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
m_label->set_text(tooltip);
|
||||
}
|
||||
|
||||
ObjectPtr<GLabel> m_label;
|
||||
RefPtr<GLabel> m_label;
|
||||
};
|
||||
|
||||
void GApplication::show_tooltip(const StringView& tooltip, const Point& screen_location)
|
||||
|
|
|
@ -36,9 +36,9 @@ protected:
|
|||
virtual void resize_event(GResizeEvent&) override;
|
||||
|
||||
private:
|
||||
ObjectPtr<GTextEditor> m_editor;
|
||||
ObjectPtr<GButton> m_open_button;
|
||||
ObjectPtr<GWindow> m_list_window;
|
||||
ObjectPtr<GListView> m_list_view;
|
||||
RefPtr<GTextEditor> m_editor;
|
||||
RefPtr<GButton> m_open_button;
|
||||
RefPtr<GWindow> m_list_window;
|
||||
RefPtr<GListView> m_list_view;
|
||||
bool m_only_allow_values_from_model { false };
|
||||
};
|
||||
|
|
|
@ -82,7 +82,7 @@ private:
|
|||
HashMap<uid_t, String> m_user_names;
|
||||
HashMap<gid_t, String> m_group_names;
|
||||
|
||||
ObjectPtr<CNotifier> m_notifier;
|
||||
RefPtr<CNotifier> m_notifier;
|
||||
|
||||
unsigned m_thumbnail_progress { 0 };
|
||||
unsigned m_thumbnail_progress_total { 0 };
|
||||
|
|
|
@ -42,13 +42,13 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
ObjectPtr<GTableView> m_view;
|
||||
RefPtr<GTableView> m_view;
|
||||
NonnullRefPtr<GDirectoryModel> m_model;
|
||||
FileSystemPath m_selected_file;
|
||||
|
||||
ObjectPtr<GTextBox> m_filename_textbox;
|
||||
ObjectPtr<GLabel> m_preview_image_label;
|
||||
ObjectPtr<GLabel> m_preview_name_label;
|
||||
ObjectPtr<GLabel> m_preview_geometry_label;
|
||||
RefPtr<GTextBox> m_filename_textbox;
|
||||
RefPtr<GLabel> m_preview_image_label;
|
||||
RefPtr<GLabel> m_preview_name_label;
|
||||
RefPtr<GLabel> m_preview_geometry_label;
|
||||
Mode m_mode { Mode::Open };
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@ private:
|
|||
String m_prompt;
|
||||
String m_text_value;
|
||||
|
||||
ObjectPtr<GButton> m_ok_button;
|
||||
ObjectPtr<GButton> m_cancel_button;
|
||||
ObjectPtr<GTextEditor> m_text_editor;
|
||||
RefPtr<GButton> m_ok_button;
|
||||
RefPtr<GButton> m_cancel_button;
|
||||
RefPtr<GTextEditor> m_text_editor;
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ void GMessageBox::build()
|
|||
widget->layout()->set_margins({ 0, 15, 0, 15 });
|
||||
widget->layout()->set_spacing(15);
|
||||
|
||||
ObjectPtr<GWidget> message_container = widget;
|
||||
RefPtr<GWidget> message_container = widget;
|
||||
if (m_type != Type::None) {
|
||||
message_container = GWidget::construct(widget.ptr());
|
||||
message_container->set_layout(make<GBoxLayout>(Orientation::Horizontal));
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
virtual void will_begin_editing() { }
|
||||
|
||||
protected:
|
||||
virtual ObjectPtr<GWidget> create_widget() = 0;
|
||||
virtual RefPtr<GWidget> create_widget() = 0;
|
||||
void commit()
|
||||
{
|
||||
if (on_commit)
|
||||
|
@ -39,7 +39,7 @@ protected:
|
|||
private:
|
||||
RefPtr<GModel> m_model;
|
||||
GModelIndex m_index;
|
||||
ObjectPtr<GWidget> m_widget;
|
||||
RefPtr<GWidget> m_widget;
|
||||
};
|
||||
|
||||
class GStringModelEditingDelegate : public GModelEditingDelegate {
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
GStringModelEditingDelegate() {}
|
||||
virtual ~GStringModelEditingDelegate() override {}
|
||||
|
||||
virtual ObjectPtr<GWidget> create_widget() override
|
||||
virtual RefPtr<GWidget> create_widget() override
|
||||
{
|
||||
auto textbox = GTextBox::construct(nullptr);
|
||||
textbox->on_return_pressed = [this] {
|
||||
|
|
|
@ -83,5 +83,5 @@ private:
|
|||
};
|
||||
|
||||
AutomaticScrollingDirection m_automatic_scrolling_direction { AutomaticScrollingDirection::None };
|
||||
ObjectPtr<CTimer> m_automatic_scrolling_timer;
|
||||
RefPtr<CTimer> m_automatic_scrolling_timer;
|
||||
};
|
||||
|
|
|
@ -53,9 +53,9 @@ protected:
|
|||
private:
|
||||
void update_scrollbar_ranges();
|
||||
|
||||
ObjectPtr<GScrollBar> m_vertical_scrollbar;
|
||||
ObjectPtr<GScrollBar> m_horizontal_scrollbar;
|
||||
ObjectPtr<GWidget> m_corner_widget;
|
||||
RefPtr<GScrollBar> m_vertical_scrollbar;
|
||||
RefPtr<GScrollBar> m_horizontal_scrollbar;
|
||||
RefPtr<GWidget> m_corner_widget;
|
||||
Size m_content_size;
|
||||
Size m_size_occupied_by_fixed_elements;
|
||||
bool m_scrollbars_enabled { true };
|
||||
|
|
|
@ -27,9 +27,9 @@ protected:
|
|||
virtual void resize_event(GResizeEvent&) override;
|
||||
|
||||
private:
|
||||
ObjectPtr<GTextEditor> m_editor;
|
||||
ObjectPtr<GButton> m_increment_button;
|
||||
ObjectPtr<GButton> m_decrement_button;
|
||||
RefPtr<GTextEditor> m_editor;
|
||||
RefPtr<GButton> m_increment_button;
|
||||
RefPtr<GButton> m_decrement_button;
|
||||
|
||||
int m_min { 0 };
|
||||
int m_max { 100 };
|
||||
|
|
|
@ -19,5 +19,5 @@ protected:
|
|||
virtual void resize_event(GResizeEvent&) override;
|
||||
|
||||
private:
|
||||
ObjectPtr<GWidget> m_active_widget;
|
||||
RefPtr<GWidget> m_active_widget;
|
||||
};
|
||||
|
|
|
@ -18,6 +18,6 @@ protected:
|
|||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
private:
|
||||
ObjectPtr<GLabel> m_label;
|
||||
ObjectPtr<GResizeCorner> m_corner;
|
||||
RefPtr<GLabel> m_label;
|
||||
RefPtr<GResizeCorner> m_corner;
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@ private:
|
|||
Rect container_rect() const;
|
||||
void update_bar();
|
||||
|
||||
ObjectPtr<GWidget> m_active_widget;
|
||||
RefPtr<GWidget> m_active_widget;
|
||||
|
||||
struct TabData {
|
||||
Rect rect(const Font&) const;
|
||||
|
|
|
@ -151,7 +151,7 @@ private:
|
|||
RefPtr<GraphicsBitmap> m_icon;
|
||||
int m_window_id { 0 };
|
||||
float m_opacity_when_windowless { 1.0f };
|
||||
ObjectPtr<GWidget> m_main_widget;
|
||||
RefPtr<GWidget> m_main_widget;
|
||||
WeakPtr<GWidget> m_focused_widget;
|
||||
WeakPtr<GWidget> m_global_cursor_tracking_widget;
|
||||
WeakPtr<GWidget> m_automatic_cursor_tracking_widget;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue