Merge pull request #113282 from dsnopek/required-ptr-get-out-there

Use `RequiredParam`/`RequiredResult` in some high value places
This commit is contained in:
Thaddeus Crews
2025-12-02 20:42:53 -06:00
79 changed files with 372 additions and 321 deletions

View File

@@ -432,10 +432,10 @@ protected:
GDVIRTUAL0RC(Vector<String>, _get_accessibility_configuration_warnings)
GDVIRTUAL0RC(Vector<String>, _get_configuration_warnings)
GDVIRTUAL1(_input, Ref<InputEvent>)
GDVIRTUAL1(_shortcut_input, Ref<InputEvent>)
GDVIRTUAL1(_unhandled_input, Ref<InputEvent>)
GDVIRTUAL1(_unhandled_key_input, Ref<InputEvent>)
GDVIRTUAL1(_input, RequiredParam<InputEvent>)
GDVIRTUAL1(_shortcut_input, RequiredParam<InputEvent>)
GDVIRTUAL1(_unhandled_input, RequiredParam<InputEvent>)
GDVIRTUAL1(_unhandled_key_input, RequiredParam<InputEvent>)
GDVIRTUAL0RC(RID, _get_focused_accessibility_element)
@@ -513,8 +513,8 @@ public:
InternalMode get_internal_mode() const;
void add_child(RequiredParam<Node> rp_child, bool p_force_readable_name = false, InternalMode p_internal = INTERNAL_MODE_DISABLED);
void add_sibling(Node *p_sibling, bool p_force_readable_name = false);
void remove_child(Node *p_child);
void add_sibling(RequiredParam<Node> rp_sibling, bool p_force_readable_name = false);
void remove_child(RequiredParam<Node> rp_child);
/// Optimal way to iterate the children of this node.
/// The caller is responsible to ensure:
@@ -534,7 +534,7 @@ public:
bool has_node_and_resource(const NodePath &p_path) const;
Node *get_node_and_resource(const NodePath &p_path, Ref<Resource> &r_res, Vector<StringName> &r_leftover_subpath, bool p_last_is_property = true) const;
virtual void reparent(Node *p_parent, bool p_keep_global_transform = true);
virtual void reparent(RequiredParam<Node> p_parent, bool p_keep_global_transform = true);
Node *get_parent() const;
Node *find_parent(const String &p_pattern) const;
@@ -553,11 +553,11 @@ public:
_FORCE_INLINE_ bool is_inside_tree() const { return data.tree; }
bool is_internal() const { return data.internal_mode != INTERNAL_MODE_DISABLED; }
bool is_ancestor_of(const Node *p_node) const;
bool is_greater_than(const Node *p_node) const;
bool is_ancestor_of(RequiredParam<const Node> p_node) const;
bool is_greater_than(RequiredParam<const Node> p_node) const;
NodePath get_path() const;
NodePath get_path_to(const Node *p_node, bool p_use_unique_path = false) const;
NodePath get_path_to(RequiredParam<const Node> p_node, bool p_use_unique_path = false) const;
Node *find_common_parent_with(const Node *p_node) const;
void add_to_group(const StringName &p_identifier, bool p_persistent = false);
@@ -572,7 +572,7 @@ public:
void get_groups(List<GroupInfo> *p_groups) const;
int get_persistent_group_count() const;
void move_child(Node *p_child, int p_index);
void move_child(RequiredParam<Node> p_child, int p_index);
void _move_child(Node *p_child, int p_index, bool p_ignore_end = false);
void set_owner(Node *p_owner);
@@ -621,8 +621,8 @@ public:
void set_editor_description(const String &p_editor_description);
String get_editor_description() const;
void set_editable_instance(Node *p_node, bool p_editable);
bool is_editable_instance(const Node *p_node) const;
void set_editable_instance(RequiredParam<Node> p_node, bool p_editable);
bool is_editable_instance(RequiredParam<const Node> p_node) const;
Node *get_deepest_editable_node(Node *p_start_node) const;
#ifdef TOOLS_ENABLED
@@ -742,7 +742,7 @@ public:
return binds;
}
void replace_by(Node *p_node, bool p_keep_groups = false);
void replace_by(RequiredParam<Node> p_node, bool p_keep_groups = false);
void set_process_mode(ProcessMode p_mode);
ProcessMode get_process_mode() const;