summaryrefslogtreecommitdiff
path: root/core/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/object.h')
-rw-r--r--core/object.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/core/object.h b/core/object.h
index 59d3f06cfe..1eaab5034e 100644
--- a/core/object.h
+++ b/core/object.h
@@ -60,7 +60,6 @@ enum PropertyHint {
PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc"
PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease) use "attenuation" hint string to revert (flip h), "full" to also include in/out. (ie: "attenuation,inout")
PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer)
- PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat. Keeping now for GDNative compat.
PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer)
PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags)
PROPERTY_HINT_LAYERS_2D_RENDER,
@@ -107,10 +106,7 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings
PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor
PROPERTY_USAGE_CATEGORY = 256,
- // FIXME: Drop in 4.0, possibly reorder other flags?
- // Those below are deprecated thanks to ClassDB's now class value cache
- //PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero
- //PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false
+ PROPERTY_USAGE_SUBGROUP = 512,
PROPERTY_USAGE_NO_INSTANCE_STATE = 2048,
PROPERTY_USAGE_RESTART_IF_CHANGED = 4096,
PROPERTY_USAGE_SCRIPT_VARIABLE = 8192,
@@ -138,6 +134,7 @@ enum PropertyUsageFlags {
#define ADD_PROPERTYI(m_property, m_setter, m_getter, m_index) ClassDB::add_property(get_class_static(), m_property, _scs_create(m_setter), _scs_create(m_getter), m_index)
#define ADD_PROPERTY_DEFAULT(m_property, m_default) ClassDB::set_property_default_value(get_class_static(), m_property, m_default)
#define ADD_GROUP(m_name, m_prefix) ClassDB::add_property_group(get_class_static(), m_name, m_prefix)
+#define ADD_SUBGROUP(m_name, m_prefix) ClassDB::add_property_subgroup(get_class_static(), m_name, m_prefix)
struct PropertyInfo {
@@ -242,7 +239,7 @@ struct MethodInfo {
//if ( is_type(T::get_class_static()) )
//return static_cast<T*>(this);
////else
-//return NULL;
+//return nullptr;
/*
the following is an incomprehensible blob of hacks and workarounds to compensate for many of the fallencies in C++. As a plus, this macro pretty much alone defines the object model.
@@ -591,11 +588,11 @@ public:
return dynamic_cast<T *>(p_object);
#else
if (!p_object)
- return NULL;
+ return nullptr;
if (p_object->is_class_ptr(T::get_class_ptr_static()))
return static_cast<T *>(p_object);
else
- return NULL;
+ return nullptr;
#endif
}
@@ -605,11 +602,11 @@ public:
return dynamic_cast<const T *>(p_object);
#else
if (!p_object)
- return NULL;
+ return nullptr;
if (p_object->is_class_ptr(T::get_class_ptr_static()))
return static_cast<const T *>(p_object);
else
- return NULL;
+ return nullptr;
#endif
}
@@ -644,10 +641,10 @@ public:
//void set(const String& p_name, const Variant& p_value);
//Variant get(const String& p_name) const;
- void set(const StringName &p_name, const Variant &p_value, bool *r_valid = NULL);
- Variant get(const StringName &p_name, bool *r_valid = NULL) const;
- void set_indexed(const Vector<StringName> &p_names, const Variant &p_value, bool *r_valid = NULL);
- Variant get_indexed(const Vector<StringName> &p_names, bool *r_valid = NULL) const;
+ void set(const StringName &p_name, const Variant &p_value, bool *r_valid = nullptr);
+ Variant get(const StringName &p_name, bool *r_valid = nullptr) const;
+ void set_indexed(const Vector<StringName> &p_names, const Variant &p_value, bool *r_valid = nullptr);
+ Variant get_indexed(const Vector<StringName> &p_names, bool *r_valid = nullptr) const;
void get_property_list(List<PropertyInfo> *p_list, bool p_reversed = false) const;
@@ -664,8 +661,8 @@ public:
String to_string();
//used mainly by script, get and set all INCLUDING string
- virtual Variant getvar(const Variant &p_key, bool *r_valid = NULL) const;
- virtual void setvar(const Variant &p_key, const Variant &p_value, bool *r_valid = NULL);
+ virtual Variant getvar(const Variant &p_key, bool *r_valid = nullptr) const;
+ virtual void setvar(const Variant &p_key, const Variant &p_value, bool *r_valid = nullptr);
/* SCRIPT */
@@ -694,6 +691,7 @@ public:
void add_user_signal(const MethodInfo &p_signal);
Error emit_signal(const StringName &p_name, VARIANT_ARG_LIST);
Error emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount);
+ bool has_signal(const StringName &p_name) const;
void get_signal_list(List<MethodInfo> *p_signals) const;
void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const;
void get_all_signal_connections(List<Connection> *p_connections) const;
@@ -714,8 +712,8 @@ public:
void set_block_signals(bool p_block);
bool is_blocking_signals() const;
- Variant::Type get_static_property_type(const StringName &p_property, bool *r_valid = NULL) const;
- Variant::Type get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid = NULL) const;
+ Variant::Type get_static_property_type(const StringName &p_property, bool *r_valid = nullptr) const;
+ Variant::Type get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid = nullptr) const;
virtual void get_translatable_strings(List<String> *p_strings) const;
@@ -816,4 +814,4 @@ public:
//needed by macros
#include "core/class_db.h"
-#endif
+#endif // OBJECT_H