1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

Libraries: Fix visibility of Object-derivative constructors

Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
This commit is contained in:
Ben Wiederhake 2021-10-31 23:38:04 +01:00 committed by Andreas Kling
parent 3796d417e0
commit b3e9a4e603
19 changed files with 62 additions and 50 deletions

View file

@ -14,7 +14,6 @@ namespace GUI {
class TextBox : public TextEditor {
C_OBJECT(TextBox)
public:
TextBox();
virtual ~TextBox() override;
Function<void()> on_up_pressed;
@ -23,6 +22,9 @@ public:
void set_history_enabled(bool enabled) { m_history_enabled = enabled; }
void add_current_text_to_history();
protected:
TextBox();
private:
virtual void keydown_event(GUI::KeyEvent&) override;
@ -39,20 +41,21 @@ private:
class PasswordBox : public TextBox {
C_OBJECT(PasswordBox)
public:
private:
PasswordBox();
};
class UrlBox : public TextBox {
C_OBJECT(UrlBox)
public:
UrlBox();
virtual ~UrlBox() override;
void set_focus_transition(bool focus_transition) { m_focus_transition = focus_transition; }
bool is_focus_transition() const { return m_focus_transition; }
private:
UrlBox();
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void focusout_event(GUI::FocusEvent&) override;