diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index d7c211ff68..ea3ef66346 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -140,6 +140,9 @@ PUBLISHED: INLINE static TypeHandle none(); INLINE operator bool () const; + MAKE_PROPERTY(index, get_index); + MAKE_PROPERTY(name, get_name); + public: INLINE static TypeHandle from_index(int index); diff --git a/dtool/src/dtoolbase/typedObject.h b/dtool/src/dtoolbase/typedObject.h index f86b9cc242..60695a1062 100644 --- a/dtool/src/dtoolbase/typedObject.h +++ b/dtool/src/dtoolbase/typedObject.h @@ -108,6 +108,7 @@ PUBLISHED: // Derived classes should override this function to return // get_class_type(). virtual TypeHandle get_type() const=0; + MAKE_PROPERTY(type, get_type); INLINE int get_type_index() const; INLINE bool is_of_type(TypeHandle handle) const; diff --git a/dtool/src/dtoolutil/globPattern.h b/dtool/src/dtoolutil/globPattern.h index f7983021b7..f1bcd007ae 100644 --- a/dtool/src/dtoolutil/globPattern.h +++ b/dtool/src/dtoolutil/globPattern.h @@ -46,12 +46,15 @@ PUBLISHED: INLINE void set_pattern(const string &pattern); INLINE const string &get_pattern() const; + MAKE_PROPERTY(pattern, get_pattern, set_pattern); INLINE void set_case_sensitive(bool case_sensitive); INLINE bool get_case_sensitive() const; + MAKE_PROPERTY(case_sensitive, get_case_sensitive, set_case_sensitive); INLINE void set_nomatch_chars(const string &nomatch_chars); INLINE const string &get_nomatch_chars() const; + MAKE_PROPERTY(nomatch_chars, get_nomatch_chars, set_nomatch_chars); INLINE bool matches(const string &candidate) const; diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index ef7e8dc877..8d976de789 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -2634,7 +2634,7 @@ write_module_class(ostream &out, Object *obj) { ++num_getset; string name1 = methodNameFromCppName(ielem.get_name(), "", false); - string name2 = methodNameFromCppName(ielem.get_name(), "", true); + //string name2 = methodNameFromCppName(ielem.get_name(), "", true); string getter = "&Dtool_" + ClassName + "_" + ielem.get_name() + "_Getter"; string setter = "NULL"; @@ -2655,13 +2655,13 @@ write_module_class(ostream &out, Object *obj) { // Extra void* argument; we don't make use of it. out << "NULL},\n"; - if (name1 != name2 && name1 != "__dict__") { + /*if (name1 != name2 && name1 != "__dict__") { // Add alternative spelling. out << " {(char *)\"" << name2 << "\", " << getter << ", " << setter << ", (char *)\n" << " \"Alias of " << name1 << ", for consistency with old naming conventions.\",\n" << " NULL},\n"; - } + }*/ } out << " {NULL},\n"; @@ -3464,7 +3464,7 @@ write_function_for_name(ostream &out, Object *obj, max_required_args = collapse_default_remaps(map_sets, max_required_args); } - if (map_sets.size() > 1) { + if (map_sets.size() > 1 && (args_type == AT_varargs || args_type == AT_keyword_args)) { switch (args_type) { case AT_keyword_args: indent(out, 2) << "int parameter_count = (int)PyTuple_Size(args);\n"; diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 1017a52628..47f662b7f5 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1905,7 +1905,14 @@ get_function(CPPInstance *function, string description, // database. //////////////////////////////////////////////////////////////////// ElementIndex InterrogateBuilder:: -get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { +get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CPPScope *scope) { + // This is needed so we can get a proper unique name for the property. + if (make_property->_ident->_native_scope != scope) { + make_property = new CPPMakeProperty(*make_property); + make_property->_ident = new CPPIdentifier(*make_property->_ident); + make_property->_ident->_native_scope = scope; + } + string property_name = make_property->get_local_name(&parser); // First, check to see if it's already there. @@ -1927,7 +1934,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { CPPInstance *function = (*fi); CPPFunctionType *ftype = function->_type->as_function_type(); - if (ftype != NULL && ftype->_parameters->_parameters.size() == 0) { + if (ftype != NULL/* && ftype->_parameters->_parameters.size() == 0*/) { getter = function; return_type = ftype->_return_type; @@ -1957,6 +1964,9 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { if (return_type != NULL) { iproperty._type = get_type(return_type, false); + //if (iproperty._type == 0) { + // parser.warning("cannot determine property type", make_property->_ident->_loc); + //} } else { iproperty._type = 0; } @@ -2609,7 +2619,7 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, } } else if ((*di)->get_subtype() == CPPDeclaration::ST_make_property) { - ElementIndex element_index = get_make_property((*di)->as_make_property(), cpptype); + ElementIndex element_index = get_make_property((*di)->as_make_property(), cpptype, scope); itype._elements.push_back(element_index); } else if ((*di)->get_subtype() == CPPDeclaration::ST_make_seq) { diff --git a/dtool/src/interrogate/interrogateBuilder.h b/dtool/src/interrogate/interrogateBuilder.h index a11b5cfaa5..78962630e7 100644 --- a/dtool/src/interrogate/interrogateBuilder.h +++ b/dtool/src/interrogate/interrogateBuilder.h @@ -113,7 +113,7 @@ public: int flags, const string &expression = string()); ElementIndex - get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type); + get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CPPScope *scope); MakeSeqIndex get_make_seq(CPPMakeSeq *make_seq, CPPStructType *struct_type); diff --git a/dtool/src/prc/configDeclaration.h b/dtool/src/prc/configDeclaration.h index ecbabc92be..e578380280 100644 --- a/dtool/src/prc/configDeclaration.h +++ b/dtool/src/prc/configDeclaration.h @@ -45,6 +45,8 @@ public: PUBLISHED: INLINE ConfigPage *get_page() const; INLINE ConfigVariableCore *get_variable() const; + MAKE_PROPERTY(page, get_page); + MAKE_PROPERTY(variable, get_variable); INLINE const string &get_string_value() const; INLINE void set_string_value(const string &value); diff --git a/dtool/src/prc/configPage.h b/dtool/src/prc/configPage.h index fe2ba92d4e..ebddb55e21 100644 --- a/dtool/src/prc/configPage.h +++ b/dtool/src/prc/configPage.h @@ -43,17 +43,22 @@ PUBLISHED: static ConfigPage *get_local_page(); INLINE const string &get_name() const; + MAKE_PROPERTY(name, get_name); INLINE bool is_special() const; INLINE bool is_implicit() const; void set_sort(int sort); INLINE int get_sort() const; + MAKE_PROPERTY(sort, get_sort, set_sort); INLINE int get_page_seq() const; INLINE int get_trust_level() const; INLINE void set_trust_level(int trust_level); INLINE const string &get_signature() const; + MAKE_PROPERTY(page_seq, get_page_seq); + MAKE_PROPERTY(trust_level, get_trust_level, set_trust_level); + MAKE_PROPERTY(signature, get_signature); void clear(); bool read_prc(istream &in); diff --git a/dtool/src/prc/configVariable.h b/dtool/src/prc/configVariable.h index 17e251a307..d3a79e3b7a 100644 --- a/dtool/src/prc/configVariable.h +++ b/dtool/src/prc/configVariable.h @@ -42,14 +42,15 @@ PUBLISHED: INLINE ConfigVariable(const string &name); INLINE ~ConfigVariable(); - INLINE const ConfigDeclaration *get_default_value() const; - INLINE const string &get_string_value() const; INLINE void set_string_value(const string &value); INLINE void clear_value(); INLINE size_t get_num_words() const; +protected: + INLINE const ConfigDeclaration *get_default_value() const; + INLINE bool has_string_word(size_t n) const; INLINE bool has_bool_word(size_t n) const; INLINE bool has_int_word(size_t n) const; diff --git a/dtool/src/prc/configVariableBase.h b/dtool/src/prc/configVariableBase.h index 6a5b09342c..805398a2d7 100644 --- a/dtool/src/prc/configVariableBase.h +++ b/dtool/src/prc/configVariableBase.h @@ -62,10 +62,17 @@ PUBLISHED: INLINE int get_trust_level() const; INLINE bool is_dynamic() const; + MAKE_PROPERTY(name, get_name); + MAKE_PROPERTY(value_type, get_value_type); + MAKE_PROPERTY(description, get_description); + MAKE_PROPERTY(closed, is_closed); + MAKE_PROPERTY(trust_level, get_trust_level); + MAKE_PROPERTY(dynamic, is_dynamic); + INLINE bool clear_local_value(); INLINE bool has_local_value() const; INLINE bool has_value() const; - + INLINE void output(ostream &out) const; INLINE void write(ostream &out) const; diff --git a/dtool/src/prc/configVariableBool.h b/dtool/src/prc/configVariableBool.h index 4dbeeaee2e..a43a867de6 100644 --- a/dtool/src/prc/configVariableBool.h +++ b/dtool/src/prc/configVariableBool.h @@ -40,6 +40,8 @@ PUBLISHED: INLINE void set_value(bool value); INLINE bool get_value() const; INLINE bool get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE bool get_word(size_t n) const; INLINE void set_word(size_t n, bool value); diff --git a/dtool/src/prc/configVariableDouble.h b/dtool/src/prc/configVariableDouble.h index 9a55c98357..6180a5056c 100644 --- a/dtool/src/prc/configVariableDouble.h +++ b/dtool/src/prc/configVariableDouble.h @@ -42,6 +42,8 @@ PUBLISHED: INLINE void set_value(double value); INLINE double get_value() const; INLINE double get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE double get_word(size_t n) const; INLINE void set_word(size_t n, double value); diff --git a/dtool/src/prc/configVariableEnum.h b/dtool/src/prc/configVariableEnum.h index b8dbfd2860..c49fe960b9 100644 --- a/dtool/src/prc/configVariableEnum.h +++ b/dtool/src/prc/configVariableEnum.h @@ -51,6 +51,8 @@ public: INLINE void set_value(EnumType value); INLINE EnumType get_value() const; INLINE EnumType get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE EnumType get_word(size_t n) const; INLINE void set_word(size_t n, EnumType value); diff --git a/dtool/src/prc/configVariableFilename.h b/dtool/src/prc/configVariableFilename.h index b6dc02ea5e..d546c25b55 100644 --- a/dtool/src/prc/configVariableFilename.h +++ b/dtool/src/prc/configVariableFilename.h @@ -58,6 +58,8 @@ PUBLISHED: INLINE void set_value(const Filename &value); INLINE Filename get_value() const; INLINE Filename get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE Filename get_word(size_t n) const; INLINE void set_word(size_t n, const Filename &value); diff --git a/dtool/src/prc/configVariableInt.h b/dtool/src/prc/configVariableInt.h index 508d6ba358..b39889d31c 100644 --- a/dtool/src/prc/configVariableInt.h +++ b/dtool/src/prc/configVariableInt.h @@ -42,6 +42,8 @@ PUBLISHED: INLINE void set_value(int value); INLINE int get_value() const; INLINE int get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE int get_word(size_t n) const; INLINE void set_word(size_t n, int value); diff --git a/dtool/src/prc/configVariableInt64.h b/dtool/src/prc/configVariableInt64.h index d108fb701a..bcbfdff044 100644 --- a/dtool/src/prc/configVariableInt64.h +++ b/dtool/src/prc/configVariableInt64.h @@ -43,6 +43,8 @@ PUBLISHED: INLINE void set_value(PN_int64 value); INLINE PN_int64 get_value() const; INLINE PN_int64 get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE PN_int64 get_word(size_t n) const; INLINE void set_word(size_t n, PN_int64 value); diff --git a/dtool/src/prc/configVariableSearchPath.h b/dtool/src/prc/configVariableSearchPath.h index ee32dab573..c2b6e1f0b6 100644 --- a/dtool/src/prc/configVariableSearchPath.h +++ b/dtool/src/prc/configVariableSearchPath.h @@ -57,6 +57,8 @@ PUBLISHED: INLINE operator const DSearchPath & () const; INLINE const DSearchPath &get_value() const; INLINE const DSearchPath &get_default_value() const; + MAKE_PROPERTY(value, get_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE bool clear_local_value(); diff --git a/dtool/src/prc/configVariableString.h b/dtool/src/prc/configVariableString.h index ae313f2933..7375a9e6ad 100644 --- a/dtool/src/prc/configVariableString.h +++ b/dtool/src/prc/configVariableString.h @@ -47,6 +47,8 @@ PUBLISHED: INLINE void set_value(const string &value); INLINE const string &get_value() const; INLINE string get_default_value() const; + MAKE_PROPERTY(value, get_value, set_value); + MAKE_PROPERTY(default_value, get_default_value); INLINE string get_word(size_t n) const; INLINE void set_word(size_t n, const string &value); diff --git a/dtool/src/prc/notifyCategory.h b/dtool/src/prc/notifyCategory.h index ad1152546f..2896a8caa2 100644 --- a/dtool/src/prc/notifyCategory.h +++ b/dtool/src/prc/notifyCategory.h @@ -43,6 +43,9 @@ PUBLISHED: INLINE string get_basename() const; INLINE NotifySeverity get_severity() const; INLINE void set_severity(NotifySeverity severity); + MAKE_PROPERTY(fullname, get_fullname); + MAKE_PROPERTY(basename, get_basename); + MAKE_PROPERTY(severity, get_severity, set_severity); INLINE bool is_on(NotifySeverity severity) const; diff --git a/panda/src/collide/collisionNode.h b/panda/src/collide/collisionNode.h index 01d1a5a60c..4ac6895acf 100644 --- a/panda/src/collide/collisionNode.h +++ b/panda/src/collide/collisionNode.h @@ -58,6 +58,11 @@ PUBLISHED: INLINE CollideMask get_from_collide_mask() const; INLINE CollideMask get_into_collide_mask() const; + MAKE_PROPERTY(from_collide_mask, get_from_collide_mask, + set_from_collide_mask); + MAKE_PROPERTY(into_collide_mask, get_into_collide_mask, + set_into_collide_mask); + INLINE void clear_solids(); INLINE int get_num_solids() const; INLINE CPT(CollisionSolid) get_solid(int n) const; @@ -69,6 +74,7 @@ PUBLISHED: INLINE int get_collider_sort() const; INLINE void set_collider_sort(int sort); + MAKE_PROPERTY(collider_sort, get_collider_sort, set_collider_sort); INLINE static CollideMask get_default_collide_mask(); diff --git a/panda/src/collide/collisionRay.h b/panda/src/collide/collisionRay.h index a8a5861c43..09650c7e78 100644 --- a/panda/src/collide/collisionRay.h +++ b/panda/src/collide/collisionRay.h @@ -52,10 +52,12 @@ PUBLISHED: INLINE void set_origin(const LPoint3 &origin); INLINE void set_origin(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z); INLINE const LPoint3 &get_origin() const; + MAKE_PROPERTY(origin, get_origin, set_origin); INLINE void set_direction(const LVector3 &direction); INLINE void set_direction(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z); INLINE const LVector3 &get_direction() const; + MAKE_PROPERTY(direction, get_direction, set_direction); bool set_from_lens(LensNode *camera, const LPoint2 &point); INLINE bool set_from_lens(LensNode *camera, PN_stdfloat px, PN_stdfloat py); diff --git a/panda/src/collide/collisionSolid.h b/panda/src/collide/collisionSolid.h index 3cf1634224..d9ea395cc2 100644 --- a/panda/src/collide/collisionSolid.h +++ b/panda/src/collide/collisionSolid.h @@ -59,9 +59,11 @@ protected: PUBLISHED: virtual LPoint3 get_collision_origin() const=0; + MAKE_PROPERTY(collision_origin, get_collision_origin); INLINE void set_tangible(bool tangible); INLINE bool is_tangible() const; + MAKE_PROPERTY(tangible, is_tangible, set_tangible); INLINE void set_effective_normal(const LVector3 &effective_normal); INLINE void clear_effective_normal(); @@ -70,10 +72,14 @@ PUBLISHED: INLINE void set_respect_effective_normal(bool respect_effective_normal); INLINE bool get_respect_effective_normal() const; + MAKE_PROPERTY(respect_effective_normal, + get_respect_effective_normal, + set_respect_effective_normal); CPT(BoundingVolume) get_bounds() const; void set_bounds(const BoundingVolume &bounding_volume); - + MAKE_PROPERTY(bounds, get_bounds, set_bounds); + public: virtual PT(CollisionEntry) test_intersection(const CollisionEntry &entry) const; diff --git a/panda/src/device/trackerData.h b/panda/src/device/trackerData.h index 6642b04486..d0ce12100a 100644 --- a/panda/src/device/trackerData.h +++ b/panda/src/device/trackerData.h @@ -46,6 +46,12 @@ public: INLINE bool has_dt() const; INLINE double get_dt() const; +PUBLISHED: + MAKE_PROPERTY(time, get_time, set_time); + MAKE_PROPERTY(pos, get_pos, set_pos); + MAKE_PROPERTY(orient, get_orient, set_orient); + MAKE_PROPERTY(dt, get_dt, set_dt); + private: enum Flags { F_has_time = 0x0001, diff --git a/panda/src/display/callbackGraphicsWindow.h b/panda/src/display/callbackGraphicsWindow.h index 7af1ddc33f..c34d324126 100644 --- a/panda/src/display/callbackGraphicsWindow.h +++ b/panda/src/display/callbackGraphicsWindow.h @@ -46,10 +46,11 @@ PUBLISHED: PUBLISHED: INLINE CallbackGraphicsWindow *get_window() const; - + MAKE_PROPERTY(window, get_window); + protected: PT(CallbackGraphicsWindow) _window; - + public: static TypeHandle get_class_type() { return _type_handle; @@ -63,7 +64,7 @@ PUBLISHED: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - + private: static TypeHandle _type_handle; }; @@ -74,7 +75,7 @@ PUBLISHED: PUBLISHED: virtual void upcall(); - + public: static TypeHandle get_class_type() { return _type_handle; @@ -104,7 +105,7 @@ PUBLISHED: private: WindowProperties &_properties; - + public: static TypeHandle get_class_type() { return _type_handle; @@ -137,9 +138,12 @@ PUBLISHED: PUBLISHED: INLINE CallbackGraphicsWindow::RenderCallbackType get_callback_type() const; INLINE GraphicsOutput::FrameMode get_frame_mode() const; + MAKE_PROPERTY(callback_type, get_callback_type); + MAKE_PROPERTY(frame_mode, get_frame_mode); INLINE void set_render_flag(bool render_flag); INLINE bool get_render_flag() const; + MAKE_PROPERTY(render_flag, get_render_flag, set_render_flag); virtual void upcall(); @@ -147,7 +151,7 @@ PUBLISHED: RenderCallbackType _callback_type; FrameMode _frame_mode; bool _render_flag; - + public: static TypeHandle get_class_type() { return _type_handle; @@ -161,7 +165,7 @@ PUBLISHED: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - + private: static TypeHandle _type_handle; }; diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 3b33590996..4e40ad0695 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -93,36 +93,49 @@ PUBLISHED: virtual void set_camera(const NodePath &camera); INLINE NodePath get_camera(Thread *current_thread = Thread::get_current_thread()) const; + MAKE_PROPERTY(camear, get_camera, set_camera); virtual void set_active(bool active); INLINE bool is_active() const; + MAKE_PROPERTY(active, is_active, set_active); virtual void set_sort(int sort); INLINE int get_sort() const; + MAKE_PROPERTY(sort, get_sort, set_sort); virtual void set_stereo_channel(Lens::StereoChannel stereo_channel); INLINE Lens::StereoChannel get_stereo_channel() const; + MAKE_PROPERTY(stereo_channel, get_stereo_channel, set_stereo_channel); + virtual void set_tex_view_offset(int tex_view_offset); INLINE int get_tex_view_offset() const; + MAKE_PROPERTY(tex_view_offset, get_tex_view_offset, set_tex_view_offset); virtual void set_incomplete_render(bool incomplete_render); INLINE bool get_incomplete_render() const; + MAKE_PROPERTY(incomplete_render, get_incomplete_render, set_incomplete_render); virtual void set_texture_reload_priority(int texture_reload_priority); INLINE int get_texture_reload_priority() const; + MAKE_PROPERTY(texture_reload_priority, get_texture_reload_priority, + set_texture_reload_priority); void set_lens_index(int index); INLINE int get_lens_index() const; + MAKE_PROPERTY(lens_index, get_lens_index, set_lens_index); virtual void set_cull_traverser(CullTraverser *trav); CullTraverser *get_cull_traverser(); + MAKE_PROPERTY(cull_traverser, get_cull_traverser, set_cull_traverser); INLINE void set_cube_map_index(int cube_map_index); virtual void set_target_tex_page(int page); INLINE int get_target_tex_page() const; + MAKE_PROPERTY(target_tex_page, get_target_tex_page, set_target_tex_page); INLINE void set_scissor_enabled(bool scissor_enabled); INLINE bool get_scissor_enabled() const; + MAKE_PROPERTY(scissor_enabled, get_scissor_enabled, set_scissor_enabled); INLINE void set_cull_callback(CallbackObject *object); INLINE void clear_cull_callback(); diff --git a/panda/src/display/drawableRegion.h b/panda/src/display/drawableRegion.h index 83929fe502..f115c50839 100644 --- a/panda/src/display/drawableRegion.h +++ b/panda/src/display/drawableRegion.h @@ -74,12 +74,15 @@ PUBLISHED: INLINE void set_clear_color(const LColor &color); INLINE const LColor &get_clear_color() const; + MAKE_PROPERTY(clear_color, get_clear_color, set_clear_color); INLINE void set_clear_depth(PN_stdfloat depth); INLINE PN_stdfloat get_clear_depth() const; + MAKE_PROPERTY(clear_depth, get_clear_depth, set_clear_depth); INLINE void set_clear_stencil(unsigned int stencil); INLINE unsigned int get_clear_stencil() const; + MAKE_PROPERTY(clear_stencil, get_clear_stencil, set_clear_stencil); virtual void set_clear_active(int n, bool clear_aux_active); virtual bool get_clear_active(int n) const; @@ -94,6 +97,8 @@ PUBLISHED: INLINE PN_stdfloat get_pixel_zoom() const; INLINE PN_stdfloat get_pixel_factor() const; virtual bool supports_pixel_zoom() const; + MAKE_PROPERTY(pixel_zoom, get_pixel_zoom, set_pixel_zoom); + MAKE_PROPERTY(pixel_factor, get_pixel_factor); static int get_renderbuffer_type(int plane); diff --git a/panda/src/display/frameBufferProperties.h b/panda/src/display/frameBufferProperties.h index 7e3861b847..dcdeb587ec 100644 --- a/panda/src/display/frameBufferProperties.h +++ b/panda/src/display/frameBufferProperties.h @@ -123,6 +123,29 @@ PUBLISHED: INLINE void set_float_color(bool n); INLINE void set_float_depth(bool n); + MAKE_PROPERTY(depth_bits, get_depth_bits, set_depth_bits); + MAKE_PROPERTY(color_bits, get_color_bits, set_color_bits); + MAKE_PROPERTY(red_bits, get_red_bits, set_red_bits); + MAKE_PROPERTY(green_bits, get_green_bits, set_green_bits); + MAKE_PROPERTY(blue_bits, get_blue_bits, set_blue_bits); + MAKE_PROPERTY(alpha_bits, get_alpha_bits, set_alpha_bits); + MAKE_PROPERTY(stencil_bits, get_stencil_bits, set_stencil_bits); + MAKE_PROPERTY(accum_bits, get_accum_bits, set_accum_bits); + MAKE_PROPERTY(aux_rgba, get_aux_rgba, set_aux_rgba); + MAKE_PROPERTY(aux_hrgba, get_aux_hrgba, set_aux_hrgba); + MAKE_PROPERTY(aux_float, get_aux_float, set_aux_float); + MAKE_PROPERTY(multisamples, get_multisamples, set_multisamples); + MAKE_PROPERTY(coverage_samples, get_coverage_samples, set_coverage_samples); + MAKE_PROPERTY(back_buffers, get_back_buffers, set_back_buffers); + MAKE_PROPERTY(indexed_color, get_indexed_color, set_indexed_color); + MAKE_PROPERTY(rgb_color, get_rgb_color, set_rgb_color); + MAKE_PROPERTY(stereo, get_stereo, set_stereo); + MAKE_PROPERTY(force_hardware, get_force_hardware, set_force_hardware); + MAKE_PROPERTY(force_software, get_force_software, set_force_software); + MAKE_PROPERTY(srgb_color, get_srgb_color, set_srgb_color); + MAKE_PROPERTY(float_color, get_float_color, set_float_color); + MAKE_PROPERTY(float_depth, get_float_depth, set_float_depth); + // Other. FrameBufferProperties(); diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index cb371076ee..8d65f9faba 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -62,17 +62,22 @@ PUBLISHED: void set_threading_model(const GraphicsThreadingModel &threading_model); GraphicsThreadingModel get_threading_model() const; + MAKE_PROPERTY(threading_model, get_threading_model, set_threading_model); INLINE const ReMutex &get_render_lock() const; + MAKE_PROPERTY(render_lock, get_render_lock); INLINE void set_auto_flip(bool auto_flip); INLINE bool get_auto_flip() const; + MAKE_PROPERTY(auto_flip, get_auto_flip, set_auto_flip); INLINE void set_portal_cull(bool value); INLINE bool get_portal_cull() const; + MAKE_PROPERTY(portal_cull, get_portal_cull, set_portal_cull); INLINE void set_default_loader(Loader *loader); INLINE Loader *get_default_loader() const; + MAKE_PROPERTY(default_loader, get_default_loader, set_default_loader); GraphicsOutput *make_output(GraphicsPipe *pipe, const string &name, int sort, diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index 7c01cff360..73b35a0e9a 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -121,6 +121,10 @@ PUBLISHED: INLINE GraphicsPipe *get_pipe() const; INLINE GraphicsEngine *get_engine() const; INLINE const string &get_name() const; + MAKE_PROPERTY(gsg, get_gsg); + MAKE_PROPERTY(pipe, get_pipe); + MAKE_PROPERTY(engine, get_engine); + MAKE_PROPERTY(name, get_name); INLINE int count_textures() const; INLINE bool has_texture() const; @@ -148,17 +152,26 @@ PUBLISHED: INLINE bool is_valid() const; INLINE bool is_nonzero_size() const; + MAKE_PROPERTY(size, get_size); + MAKE_PROPERTY(fb_size, get_fb_size); + MAKE_PROPERTY(sbs_left_size, get_sbs_left_size); + MAKE_PROPERTY(sbs_right_size, get_sbs_right_size); + void set_active(bool active); virtual bool is_active() const; + MAKE_PROPERTY(active, is_active, set_active); void set_one_shot(bool one_shot); bool get_one_shot() const; + MAKE_PROPERTY(one_shot, get_one_shot, set_one_shot); void set_inverted(bool inverted); INLINE bool get_inverted() const; + MAKE_PROPERTY(inverted, get_inverted, set_inverted); INLINE void set_swap_eyes(bool swap_eyes); INLINE bool get_swap_eyes() const; + MAKE_PROPERTY(swap_eyes, get_swap_eyes, set_swap_eyes); INLINE void set_red_blue_stereo(bool red_blue_stereo, unsigned int left_eye_color_mask, @@ -183,6 +196,7 @@ PUBLISHED: virtual void set_sort(int sort); INLINE int get_sort() const; + MAKE_PROPERTY(sort, get_sort, set_sort); INLINE void set_child_sort(int child_sort); INLINE void clear_child_sort(); @@ -236,6 +250,7 @@ PUBLISHED: virtual void unshare_depth_buffer(); virtual bool get_supports_render_texture() const; + MAKE_PROPERTY(supports_render_texture, get_supports_render_texture); PUBLISHED: // These are not intended to be called directly by the user, but diff --git a/panda/src/display/graphicsPipe.h b/panda/src/display/graphicsPipe.h index d505af7a1e..83536944e9 100644 --- a/panda/src/display/graphicsPipe.h +++ b/panda/src/display/graphicsPipe.h @@ -98,11 +98,16 @@ PUBLISHED: INLINE int get_display_width() const; INLINE int get_display_height() const; + MAKE_PROPERTY(display_width, get_display_width); + MAKE_PROPERTY(display_height, get_display_height); DisplayInformation *get_display_information(); + MAKE_PROPERTY(display_information, get_display_information); + virtual void lookup_cpu_data(); virtual string get_interface_name() const=0; + MAKE_PROPERTY(interface_name, get_interface_name); public: enum PreferredWindowThread { diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 8e7867b583..3854bcc75f 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -97,20 +97,27 @@ PUBLISHED: INLINE bool is_active() const; INLINE bool is_valid() const; INLINE bool needs_reset() const; + MAKE_PROPERTY(active, is_active, set_active); + MAKE_PROPERTY(valid, is_valid); INLINE void set_incomplete_render(bool incomplete_render); virtual INLINE bool get_incomplete_render() const; virtual INLINE bool get_effective_incomplete_render() const; + MAKE_PROPERTY(incomplete_render, get_incomplete_render, set_incomplete_render); + MAKE_PROPERTY(effective_incomplete_render, get_effective_incomplete_render); INLINE void set_loader(Loader *loader); INLINE Loader *get_loader() const; + MAKE_PROPERTY(loader, get_loader, set_loader); INLINE void set_shader_generator(ShaderGenerator *shader_generator); INLINE ShaderGenerator *get_shader_generator() const; + MAKE_PROPERTY(shader_generator, get_shader_generator, set_shader_generator); INLINE GraphicsPipe *get_pipe() const; GraphicsEngine *get_engine() const; INLINE const GraphicsThreadingModel &get_threading_model() const; + MAKE_PROPERTY(pipe, get_pipe); INLINE bool is_hardware() const; virtual INLINE bool prefers_triangle_strips() const; @@ -170,8 +177,54 @@ PUBLISHED: INLINE int get_max_color_targets() const; INLINE int get_maximum_simultaneous_render_targets() const; + MAKE_PROPERTY(max_vertices_per_array, get_max_vertices_per_array); + MAKE_PROPERTY(max_vertices_per_primitive, get_max_vertices_per_primitive); + MAKE_PROPERTY(max_texture_stages, get_max_texture_stages); + MAKE_PROPERTY(max_texture_dimension, get_max_texture_dimension); + MAKE_PROPERTY(max_3d_texture_dimension, get_max_3d_texture_dimension); + MAKE_PROPERTY(max_2d_texture_array_layers, get_max_2d_texture_array_layers); + MAKE_PROPERTY(max_cube_map_dimension, get_max_cube_map_dimension); + MAKE_PROPERTY(max_buffer_texture_size, get_max_buffer_texture_size); + MAKE_PROPERTY(supports_texture_combine, get_supports_texture_combine); + MAKE_PROPERTY(supports_texture_saved_result, get_supports_texture_saved_result); + MAKE_PROPERTY(supports_texture_dot3, get_supports_texture_dot3); + MAKE_PROPERTY(supports_3d_texture, get_supports_3d_texture); + MAKE_PROPERTY(supports_2d_texture_array, get_supports_2d_texture_array); + MAKE_PROPERTY(supports_cube_map, get_supports_cube_map); + MAKE_PROPERTY(supports_buffer_texture, get_supports_buffer_texture); + MAKE_PROPERTY(supports_cube_map_array, get_supports_cube_map_array); + MAKE_PROPERTY(supports_tex_non_pow2, get_supports_tex_non_pow2); + MAKE_PROPERTY(supports_texture_srgb, get_supports_texture_srgb); + MAKE_PROPERTY(supports_compressed_texture, get_supports_compressed_texture); + MAKE_PROPERTY(max_lights, get_max_lights); + MAKE_PROPERTY(max_clip_planes, get_max_clip_planes); + MAKE_PROPERTY(max_vertex_transforms, get_max_vertex_transforms); + MAKE_PROPERTY(max_vertex_transform_indices, get_max_vertex_transform_indices); + MAKE_PROPERTY(copy_texture_inverted, get_copy_texture_inverted); + MAKE_PROPERTY(supports_multisample, get_supports_multisample); + MAKE_PROPERTY(supports_generate_mipmap, get_supports_generate_mipmap); + MAKE_PROPERTY(supports_depth_texture, get_supports_depth_texture); + MAKE_PROPERTY(supports_depth_stencil, get_supports_depth_stencil); + MAKE_PROPERTY(supports_shadow_filter, get_supports_shadow_filter); + MAKE_PROPERTY(supports_sampler_objects, get_supports_sampler_objects); + MAKE_PROPERTY(supports_basic_shaders, get_supports_basic_shaders); + MAKE_PROPERTY(supports_geometry_shaders, get_supports_geometry_shaders); + MAKE_PROPERTY(supports_tessellation_shaders, get_supports_tessellation_shaders); + MAKE_PROPERTY(supports_compute_shaders, get_supports_compute_shaders); + MAKE_PROPERTY(supports_glsl, get_supports_glsl); + MAKE_PROPERTY(supports_hlsl, get_supports_hlsl); + MAKE_PROPERTY(supports_stencil, get_supports_stencil); + MAKE_PROPERTY(supports_two_sided_stencil, get_supports_two_sided_stencil); + MAKE_PROPERTY(supports_geometry_instancing, get_supports_geometry_instancing); + MAKE_PROPERTY(supports_indirect_draw, get_supports_indirect_draw); + MAKE_PROPERTY(supports_occlusion_query, get_supports_occlusion_query); + MAKE_PROPERTY(supports_timer_query, get_supports_timer_query); + MAKE_PROPERTY(timer_queries_active, get_timer_queries_active); + MAKE_PROPERTY(max_color_targets, get_max_color_targets); + INLINE ShaderModel get_shader_model() const; INLINE void set_shader_model(ShaderModel shader_model); + MAKE_PROPERTY(shader_model, get_shader_model, set_shader_model); virtual int get_supported_geom_rendering() const; virtual bool get_supports_cg_profile(const string &name) const; @@ -186,15 +239,20 @@ PUBLISHED: void set_coordinate_system(CoordinateSystem cs); INLINE CoordinateSystem get_coordinate_system() const; virtual CoordinateSystem get_internal_coordinate_system() const; + MAKE_PROPERTY(coordinate_system, get_coordinate_system, set_coordinate_system); virtual PreparedGraphicsObjects *get_prepared_objects(); + MAKE_PROPERTY(prepared_objects, get_prepared_objects); virtual bool set_gamma(PN_stdfloat gamma); PN_stdfloat get_gamma(PN_stdfloat gamma); virtual void restore_gamma(); + MAKE_PROPERTY(get_gamma, set_gamma); INLINE void set_texture_quality_override(Texture::QualityLevel quality_level); INLINE Texture::QualityLevel get_texture_quality_override() const; + MAKE_PROPERTY(texture_quality_override, get_texture_quality_override, + set_texture_quality_override); EXTENSION(PyObject *get_prepared_textures() const); typedef bool TextureCallback(TextureContext *tc, void *callback_arg); @@ -204,6 +262,7 @@ PUBLISHED: void set_flash_texture(Texture *tex); void clear_flash_texture(); Texture *get_flash_texture() const; + MAKE_PROPERTY(flash_texture, get_flash_texture, set_flash_texture); #endif PUBLISHED: @@ -217,8 +276,17 @@ PUBLISHED: virtual int get_driver_shader_version_major(); virtual int get_driver_shader_version_minor(); + MAKE_PROPERTY(driver_vendor, get_driver_vendor); + MAKE_PROPERTY(driver_renderer, get_driver_renderer); + MAKE_PROPERTY(driver_version, get_driver_version); + MAKE_PROPERTY(driver_version_major, get_driver_version_major); + MAKE_PROPERTY(driver_version_minor, get_driver_version_minor); + MAKE_PROPERTY(driver_shader_version_major, get_driver_shader_version_major); + MAKE_PROPERTY(driver_shader_version_minor, get_driver_shader_version_minor); + bool set_scene(SceneSetup *scene_setup); virtual SceneSetup *get_scene() const; + MAKE_PROPERTY(scene, get_scene, set_scene); public: virtual TextureContext *prepare_texture(Texture *tex); diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index f30d721075..e7ebab8c80 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -63,16 +63,25 @@ PUBLISHED: virtual bool is_active() const; INLINE bool is_fullscreen() const; + MAKE_PROPERTY(properties, get_properties); + MAKE_PROPERTY(requested_properties, get_requested_properties); + MAKE_PROPERTY(rejected_properties, get_rejected_properties); + MAKE_PROPERTY(closed, is_closed); + void set_window_event(const string &window_event); string get_window_event() const; + MAKE_PROPERTY(window_event, get_window_event, set_window_event); void set_close_request_event(const string &close_request_event); string get_close_request_event() const; + MAKE_PROPERTY(close_request_event, get_close_request_event, set_close_request_event); INLINE void set_unexposed_draw(bool unexposed_draw); INLINE bool get_unexposed_draw() const; + MAKE_PROPERTY(unexposed_draw, get_unexposed_draw, set_unexposed_draw); INLINE WindowHandle *get_window_handle() const; + MAKE_PROPERTY(window_handle, get_window_handle); // Mouse and keyboard routines int get_num_input_devices() const; diff --git a/panda/src/display/windowHandle.h b/panda/src/display/windowHandle.h index 54ad80cba3..ef4a64f763 100644 --- a/panda/src/display/windowHandle.h +++ b/panda/src/display/windowHandle.h @@ -47,6 +47,7 @@ PUBLISHED: INLINE OSHandle *get_os_handle() const; INLINE void set_os_handle(OSHandle *os_handle); + MAKE_PROPERTY(os_handle, get_os_handle, set_os_handle); void send_windows_message(unsigned int msg, int wparam, int lparam); diff --git a/panda/src/event/pythonTask.h b/panda/src/event/pythonTask.h index 999b5e6454..b93443528c 100644 --- a/panda/src/event/pythonTask.h +++ b/panda/src/event/pythonTask.h @@ -72,9 +72,15 @@ PUBLISHED: // If the task's status is not S_sleeping, this contains 0.0. MAKE_PROPERTY(wake_time, get_wake_time); + // Alias of wake_time. + MAKE_PROPERTY(wakeTime, get_wake_time); + // The delay value that has been set on this task, if any, or None. MAKE_PROPERTY(delay_time, get_delay, set_delay); + // Alias of delay_time. + MAKE_PROPERTY(delayTime, get_delay, set_delay); + // The number of frames that have elapsed since the task was // started, according to the task manager's clock. MAKE_PROPERTY(frame, get_elapsed_frames); diff --git a/panda/src/express/namable.h b/panda/src/express/namable.h index 84e01b0919..796c65cdb6 100644 --- a/panda/src/express/namable.h +++ b/panda/src/express/namable.h @@ -40,6 +40,7 @@ PUBLISHED: INLINE void clear_name(); INLINE bool has_name() const; INLINE const string &get_name() const; + MAKE_PROPERTY(name, get_name, set_name); // In the absence of any definition to the contrary, outputting a // Namable will write out its name. diff --git a/panda/src/express/referenceCount.h b/panda/src/express/referenceCount.h index bb3526e2fa..385e12b698 100644 --- a/panda/src/express/referenceCount.h +++ b/panda/src/express/referenceCount.h @@ -52,6 +52,9 @@ PUBLISHED: INLINE void ref() const; virtual INLINE bool unref() const; + // The current reference count. + MAKE_PROPERTY(ref_count, get_ref_count); + INLINE bool test_ref_count_integrity() const; INLINE bool test_ref_count_nonzero() const; diff --git a/panda/src/express/trueClock.h b/panda/src/express/trueClock.h index d3d7e7ebc8..4598c9a03e 100644 --- a/panda/src/express/trueClock.h +++ b/panda/src/express/trueClock.h @@ -42,19 +42,23 @@ PUBLISHED: // intervals, but it should not drift substantially over the long // haul. double get_long_time(); + MAKE_PROPERTY(long_time, get_long_time); // get_short_time() returns the most precise timer we have over a // short interval. It may tend to drift over the long haul, but it // should have lots of digits to measure short intervals very // precisely. INLINE double get_short_time(); + MAKE_PROPERTY(short_time, get_short_time); // get_short_raw_time() is like get_short_time(), but does not apply // any corrections (e.g. paranoid-clock) to the result returned by // the OS. double get_short_raw_time(); + MAKE_PROPERTY(short_raw_time, get_short_raw_time); INLINE int get_error_count() const; + MAKE_PROPERTY(error_count, get_error_count); INLINE static TrueClock *get_global_ptr(); diff --git a/panda/src/gobj/lens.h b/panda/src/gobj/lens.h index 5064656898..e2e8a1c794 100644 --- a/panda/src/gobj/lens.h +++ b/panda/src/gobj/lens.h @@ -70,6 +70,7 @@ PUBLISHED: INLINE void set_change_event(const string &event); INLINE const string &get_change_event() const; + MAKE_PROPERTY(change_event, get_change_event, set_change_event); void set_coordinate_system(CoordinateSystem cs); INLINE CoordinateSystem get_coordinate_system() const; @@ -80,13 +81,16 @@ PUBLISHED: INLINE void set_film_size(PN_stdfloat width, PN_stdfloat height); INLINE void set_film_size(const LVecBase2 &film_size); INLINE const LVecBase2 &get_film_size() const; + MAKE_PROPERTY(film_size, get_film_size, set_film_size); INLINE void set_film_offset(PN_stdfloat x, PN_stdfloat y); INLINE void set_film_offset(const LVecBase2 &film_offset); INLINE const LVector2 &get_film_offset() const; + MAKE_PROPERTY(film_offset, get_film_offset, set_film_offset); INLINE void set_focal_length(PN_stdfloat focal_length); INLINE PN_stdfloat get_focal_length() const; + MAKE_PROPERTY(focal_length, get_focal_length, set_focal_length); void set_min_fov(PN_stdfloat min_fov); INLINE void set_fov(PN_stdfloat fov); @@ -96,45 +100,57 @@ PUBLISHED: INLINE PN_stdfloat get_hfov() const; INLINE PN_stdfloat get_vfov() const; PN_stdfloat get_min_fov() const; + MAKE_PROPERTY(fov, get_fov, set_fov); + MAKE_PROPERTY(min_fov, get_min_fov, set_min_fov); INLINE void set_aspect_ratio(PN_stdfloat aspect_ratio); INLINE PN_stdfloat get_aspect_ratio() const; + MAKE_PROPERTY(aspect_ratio, get_aspect_ratio, set_aspect_ratio); INLINE void set_near(PN_stdfloat near_distance); INLINE PN_stdfloat get_near() const; INLINE void set_far(PN_stdfloat far_distance); INLINE PN_stdfloat get_far() const; INLINE void set_near_far(PN_stdfloat near_distance, PN_stdfloat far_distance); + MAKE_PROPERTY(near, get_near, set_near); + MAKE_PROPERTY(far, get_far, set_far); static PN_stdfloat get_default_near(); static PN_stdfloat get_default_far(); - + INLINE void set_view_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r); void set_view_hpr(const LVecBase3 &view_hpr); const LVecBase3 &get_view_hpr() const; + MAKE_PROPERTY(view_hpr, get_view_hpr, set_view_hpr); + INLINE void set_view_vector(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat i, PN_stdfloat j, PN_stdfloat k); void set_view_vector(const LVector3 &view_vector, const LVector3 &up_vector); const LVector3 &get_view_vector() const; const LVector3 &get_up_vector() const; LPoint3 get_nodal_point() const; + MAKE_PROPERTY(nodal_point, get_nodal_point); INLINE void set_interocular_distance(PN_stdfloat interocular_distance); INLINE PN_stdfloat get_interocular_distance() const; INLINE void set_convergence_distance(PN_stdfloat convergence_distance); INLINE PN_stdfloat get_convergence_distance() const; + MAKE_PROPERTY(interocular_distance, get_interocular_distance, set_interocular_distance); + MAKE_PROPERTY(convergence_distance, get_convergence_distance, set_convergence_distance); INLINE void set_view_mat(const LMatrix4 &view_mat); INLINE const LMatrix4 &get_view_mat() const; void clear_view_mat(); + MAKE_PROPERTY(view_mat, get_view_mat, set_view_mat); void set_keystone(const LVecBase2 &keystone); INLINE const LVecBase2 &get_keystone() const; void clear_keystone(); + MAKE_PROPERTY(keystone, get_keystone, set_keystone); void set_custom_film_mat(const LMatrix4 &custom_film_mat); INLINE const LMatrix4 &get_custom_film_mat() const; void clear_custom_film_mat(); - + // These flags are passed in as the last parameter to control the // behavior of set_frustum_from_corners(). See the documentation // for that method for an explanation of each flag. diff --git a/panda/src/gobj/samplerState.h b/panda/src/gobj/samplerState.h index de3e4d6cf5..ed785303d6 100644 --- a/panda/src/gobj/samplerState.h +++ b/panda/src/gobj/samplerState.h @@ -111,6 +111,20 @@ PUBLISHED: INLINE PN_stdfloat get_max_lod() const; INLINE PN_stdfloat get_lod_bias() const; + MAKE_PROPERTY(wrap_u, get_wrap_u, set_wrap_u); + MAKE_PROPERTY(wrap_v, get_wrap_v, set_wrap_v); + MAKE_PROPERTY(wrap_w, get_wrap_w, set_wrap_w); + MAKE_PROPERTY(minfilter, get_minfilter, set_minfilter); + MAKE_PROPERTY(magfilter, get_magfilter, set_magfilter); + MAKE_PROPERTY(effective_minfilter, get_effective_minfilter); + MAKE_PROPERTY(effective_magfilter, get_effective_magfilter); + MAKE_PROPERTY(anisotropic_degree, get_anisotropic_degree, set_anisotropic_degree); + MAKE_PROPERTY(effective_anisotropic_degree, get_effective_anisotropic_degree); + MAKE_PROPERTY(border_color, get_border_color, set_border_color); + MAKE_PROPERTY(min_lod, get_min_lod, set_min_lod); + MAKE_PROPERTY(max_lod, get_max_lod, set_max_lod); + MAKE_PROPERTY(lod_bias, get_lod_bias, set_lod_bias); + INLINE bool uses_mipmaps() const; INLINE static bool is_mipmap(FilterType type); diff --git a/panda/src/pgraph/camera.h b/panda/src/pgraph/camera.h index a01685abab..35b21b8894 100644 --- a/panda/src/pgraph/camera.h +++ b/panda/src/pgraph/camera.h @@ -49,9 +49,11 @@ public: PUBLISHED: INLINE void set_active(bool active); INLINE bool is_active() const; + MAKE_PROPERTY(active, is_active, set_active); INLINE void set_scene(const NodePath &scene); INLINE const NodePath &get_scene() const; + MAKE_PROPERTY(scene, get_scene, set_scene); INLINE int get_num_display_regions() const; INLINE DisplayRegionBase *get_display_region(int n) const; @@ -59,24 +61,31 @@ PUBLISHED: INLINE void set_camera_mask(DrawMask mask); INLINE DrawMask get_camera_mask() const; + MAKE_PROPERTY(camera_mask, get_camera_mask, set_camera_mask); INLINE void set_cull_center(const NodePath &cull_center); INLINE const NodePath &get_cull_center() const; + MAKE_PROPERTY(cull_center, get_cull_center, set_cull_center); INLINE void set_cull_bounds(BoundingVolume *cull_bounds); INLINE BoundingVolume *get_cull_bounds() const; + MAKE_PROPERTY(cull_bounds, get_cull_bounds, set_cull_bounds); INLINE void set_lod_center(const NodePath &lod_center); INLINE const NodePath &get_lod_center() const; + MAKE_PROPERTY(lod_center, get_lod_center, set_lod_center); INLINE void set_initial_state(const RenderState *state); INLINE CPT(RenderState) get_initial_state() const; + MAKE_PROPERTY(initial_state, get_initial_state, set_initial_state); INLINE void set_tag_state_key(const string &tag_state_key); INLINE const string &get_tag_state_key() const; + MAKE_PROPERTY(tag_state_key, get_tag_state_key, set_tag_state_key); INLINE void set_lod_scale(PN_stdfloat value); INLINE PN_stdfloat get_lod_scale() const; + MAKE_PROPERTY(lod_scale, get_lod_scale, set_lod_scale); void set_tag_state(const string &tag_state, const RenderState *state); void clear_tag_state(const string &tag_state); diff --git a/panda/src/pgraph/light.h b/panda/src/pgraph/light.h index f6bab991c2..26d32f0c9a 100644 --- a/panda/src/pgraph/light.h +++ b/panda/src/pgraph/light.h @@ -50,6 +50,7 @@ PUBLISHED: INLINE const LColor &get_color() const; INLINE void set_color(const LColor &color); + MAKE_PROPERTY(color, get_color, set_color); virtual PN_stdfloat get_exponent() const; virtual const LColor &get_specular_color() const; @@ -58,6 +59,7 @@ PUBLISHED: INLINE void set_priority(int priority); INLINE int get_priority() const; virtual int get_class_priority() const=0; + MAKE_PROPERTY(priority, get_priority, set_priority); public: virtual void output(ostream &out) const=0; diff --git a/panda/src/pgraph/modelRoot.h b/panda/src/pgraph/modelRoot.h index e0efe88e14..d0bdd750cb 100644 --- a/panda/src/pgraph/modelRoot.h +++ b/panda/src/pgraph/modelRoot.h @@ -34,12 +34,15 @@ PUBLISHED: INLINE ModelRoot(const Filename &fulllpath, time_t timestamp); INLINE int get_model_ref_count() const; + MAKE_PROPERTY(model_ref_count, get_model_ref_count); INLINE const Filename &get_fullpath() const; INLINE void set_fullpath(const Filename &fullpath); + MAKE_PROPERTY(fullpath, get_fullpath, set_fullpath); INLINE time_t get_timestamp() const; INLINE void set_timestamp(time_t timestamp); + MAKE_PROPERTY(timestamp, get_timestamp, set_timestamp); // This class is used to unify references to the same model. class ModelReference : public ReferenceCount { @@ -49,6 +52,7 @@ PUBLISHED: INLINE ModelReference *get_reference() const; void set_reference(ModelReference *ref); + MAKE_PROPERTY(reference, get_reference, set_reference); protected: INLINE ModelRoot(const ModelRoot ©); diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 6bfaa18bc2..3aa1efd62d 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -171,20 +171,24 @@ PUBLISHED: void set_state(const RenderState *state, Thread *current_thread = Thread::get_current_thread()); INLINE CPT(RenderState) get_state(Thread *current_thread = Thread::get_current_thread()) const; INLINE void clear_state(Thread *current_thread = Thread::get_current_thread()); + MAKE_PROPERTY(state, get_state, set_state); void set_effects(const RenderEffects *effects, Thread *current_thread = Thread::get_current_thread()); INLINE CPT(RenderEffects) get_effects(Thread *current_thread = Thread::get_current_thread()) const; INLINE void clear_effects(Thread *current_thread = Thread::get_current_thread()); + MAKE_PROPERTY(effects, get_effects, set_effects); void set_transform(const TransformState *transform, Thread *current_thread = Thread::get_current_thread()); INLINE CPT(TransformState) get_transform(Thread *current_thread = Thread::get_current_thread()) const; INLINE void clear_transform(Thread *current_thread = Thread::get_current_thread()); + MAKE_PROPERTY(transform, get_transform, set_transform); void set_prev_transform(const TransformState *transform, Thread *current_thread = Thread::get_current_thread()); INLINE CPT(TransformState) get_prev_transform(Thread *current_thread = Thread::get_current_thread()) const; void reset_prev_transform(Thread *current_thread = Thread::get_current_thread()); INLINE bool has_dirty_prev_transform() const; static void reset_all_prev_transform(Thread *current_thread = Thread::get_current_thread()); + MAKE_PROPERTY(prev_transform, get_prev_transform); void set_tag(const string &key, const string &value, Thread *current_thread = Thread::get_current_thread()); @@ -302,7 +306,6 @@ PUBLISHED: }; INLINE int get_fancy_bits(Thread *current_thread = Thread::get_current_thread()) const; - PUBLISHED: static PT(PandaNode) decode_from_bam_stream(const string &data, BamReader *reader = NULL); diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index 0de6f213fe..3b48722775 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -156,6 +156,14 @@ PUBLISHED: INLINE PN_stdfloat get_shear2d() const; INLINE LMatrix3 get_mat3() const; + MAKE_PROPERTY(pos, get_pos); + MAKE_PROPERTY(hpr, get_hpr); + MAKE_PROPERTY(quat, get_quat); + MAKE_PROPERTY(norm_quat, get_norm_quat); + MAKE_PROPERTY(scale, get_scale); + MAKE_PROPERTY(shear, get_shear); + MAKE_PROPERTY(mat, get_mat); + CPT(TransformState) set_pos(const LVecBase3 &pos) const; CPT(TransformState) set_hpr(const LVecBase3 &hpr) const; CPT(TransformState) set_quat(const LQuaternion &quat) const; @@ -209,7 +217,6 @@ PUBLISHED: EXTENSION(static PyObject *get_states()); EXTENSION(static PyObject *get_unused_states()); - public: static void init_states(); diff --git a/panda/src/pgraphnodes/directionalLight.h b/panda/src/pgraphnodes/directionalLight.h index 2a7978bfbb..aa030c908b 100644 --- a/panda/src/pgraphnodes/directionalLight.h +++ b/panda/src/pgraphnodes/directionalLight.h @@ -43,12 +43,15 @@ public: PUBLISHED: INLINE const LColor &get_specular_color() const FINAL; INLINE void set_specular_color(const LColor &color); + MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); INLINE const LPoint3 &get_point() const; INLINE void set_point(const LPoint3 &point); + MAKE_PROPERTY(point, get_point, set_point); INLINE const LVector3 &get_direction() const; INLINE void set_direction(const LVector3 &direction); + MAKE_PROPERTY(direction, get_direction, set_direction); virtual int get_class_priority() const; diff --git a/panda/src/pgraphnodes/pointLight.h b/panda/src/pgraphnodes/pointLight.h index 6427ff6ddc..7cff02cfe8 100644 --- a/panda/src/pgraphnodes/pointLight.h +++ b/panda/src/pgraphnodes/pointLight.h @@ -43,12 +43,15 @@ public: PUBLISHED: INLINE const LColor &get_specular_color() const FINAL; INLINE void set_specular_color(const LColor &color); + MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); INLINE const LVecBase3 &get_attenuation() const FINAL; INLINE void set_attenuation(const LVecBase3 &attenuation); + MAKE_PROPERTY(attenuation, get_attenuation, set_attenuation); INLINE const LPoint3 &get_point() const; INLINE void set_point(const LPoint3 &point); + MAKE_PROPERTY(point, get_point, set_point); virtual int get_class_priority() const; diff --git a/panda/src/pstatclient/pStatThread.h b/panda/src/pstatclient/pStatThread.h index 36a091faeb..db1f4c1bda 100644 --- a/panda/src/pstatclient/pStatThread.h +++ b/panda/src/pstatclient/pStatThread.h @@ -45,6 +45,9 @@ PUBLISHED: Thread *get_thread() const; INLINE int get_index() const; + MAKE_PROPERTY(thread, get_thread); + MAKE_PROPERTY(index, get_index); + private: PStatClient *_client; int _index; diff --git a/panda/src/putil/buttonHandle.I b/panda/src/putil/buttonHandle.I index 59d68ec609..ee12c6e13b 100644 --- a/panda/src/putil/buttonHandle.I +++ b/panda/src/putil/buttonHandle.I @@ -33,7 +33,7 @@ ButtonHandle() { // index number, which may have been returned by an // earlier call to ButtonHandle::get_index(). //////////////////////////////////////////////////////////////////// -INLINE ButtonHandle:: +CONSTEXPR ButtonHandle:: ButtonHandle(int index) : _index(index) { } @@ -180,7 +180,7 @@ matches(const ButtonHandle &other) const { // for the convenience of non-C++ scripting languages to // build a hashtable of ButtonHandles. //////////////////////////////////////////////////////////////////// -INLINE int ButtonHandle:: +CONSTEXPR int ButtonHandle:: get_index() const { return _index; } diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index dcb0e82db3..071abf3d39 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -28,7 +28,7 @@ class EXPCL_PANDA_PUTIL ButtonHandle FINAL { PUBLISHED: INLINE ButtonHandle(); - INLINE ButtonHandle(int index); + CONSTEXPR ButtonHandle(int index); INLINE ButtonHandle(const ButtonHandle ©); ButtonHandle(const string &name); @@ -50,12 +50,16 @@ PUBLISHED: INLINE bool matches(const ButtonHandle &other) const; - INLINE int get_index() const; + CONSTEXPR int get_index() const; INLINE void output(ostream &out) const; INLINE static ButtonHandle none(); INLINE operator bool () const; + MAKE_PROPERTY(index, get_index); + MAKE_PROPERTY(name, get_name); + MAKE_PROPERTY(alias, get_alias); + private: int _index; static ButtonHandle _none; diff --git a/panda/src/putil/clockObject.h b/panda/src/putil/clockObject.h index 4f0e1a7582..a21c487bb1 100644 --- a/panda/src/putil/clockObject.h +++ b/panda/src/putil/clockObject.h @@ -82,6 +82,7 @@ PUBLISHED: void set_mode(Mode mode); INLINE Mode get_mode() const; + MAKE_PROPERTY(mode, get_mode, set_mode); INLINE double get_frame_time(Thread *current_thread = Thread::get_current_thread()) const; INLINE double get_real_time() const; @@ -95,21 +96,35 @@ PUBLISHED: INLINE int get_frame_count(Thread *current_thread = Thread::get_current_thread()) const; INLINE double get_net_frame_rate(Thread *current_thread = Thread::get_current_thread()) const; + MAKE_PROPERTY(frame_time, get_frame_time, set_frame_time); + MAKE_PROPERTY(real_time, get_real_time, set_real_time); + MAKE_PROPERTY(long_time, get_long_time); + MAKE_PROPERTY(frame_count, get_frame_count, set_frame_count); + INLINE double get_dt(Thread *current_thread = Thread::get_current_thread()) const; void set_dt(double dt); void set_frame_rate(double frame_rate); + MAKE_PROPERTY(dt, get_dt, set_dt); INLINE double get_max_dt() const; INLINE void set_max_dt(double max_dt); + MAKE_PROPERTY(max_dt, get_max_dt, set_max_dt); INLINE double get_degrade_factor() const; INLINE void set_degrade_factor(double degrade_factor); + MAKE_PROPERTY(degrade_factor, get_degrade_factor, set_degrade_factor); INLINE void set_average_frame_rate_interval(double time); INLINE double get_average_frame_rate_interval() const; + MAKE_PROPERTY(average_frame_rate_interval, + get_average_frame_rate_interval, + set_average_frame_rate_interval); + double get_average_frame_rate(Thread *current_thread = Thread::get_current_thread()) const; double get_max_frame_duration(Thread *current_thread = Thread::get_current_thread()) const; double calc_frame_rate_deviation(Thread *current_thread = Thread::get_current_thread()) const; + MAKE_PROPERTY(average_frame_rate, get_average_frame_rate); + MAKE_PROPERTY(max_frame_duration, get_max_frame_duration); void tick(Thread *current_thread = Thread::get_current_thread()); void sync_frame_time(Thread *current_thread = Thread::get_current_thread()); diff --git a/panda/src/putil/loaderOptions.h b/panda/src/putil/loaderOptions.h index 5d722bc1de..569694c6e5 100644 --- a/panda/src/putil/loaderOptions.h +++ b/panda/src/putil/loaderOptions.h @@ -57,14 +57,20 @@ PUBLISHED: INLINE void set_flags(int flags); INLINE int get_flags() const; + MAKE_PROPERTY(flags, get_flags, set_flags); INLINE void set_texture_flags(int flags); INLINE int get_texture_flags() const; INLINE void set_texture_num_views(int num_views); INLINE int get_texture_num_views() const; + MAKE_PROPERTY(texture_flags, get_texture_flags, set_texture_flags); + MAKE_PROPERTY(texture_num_views, get_texture_num_views, + set_texture_num_views); INLINE void set_auto_texture_scale(AutoTextureScale scale); INLINE AutoTextureScale get_auto_texture_scale() const; + MAKE_PROPERTY(auto_texture_scale, get_auto_texture_scale, + set_auto_texture_scale); void output(ostream &out) const; diff --git a/panda/src/putil/mouseData.h b/panda/src/putil/mouseData.h index b0b581a816..27464db200 100644 --- a/panda/src/putil/mouseData.h +++ b/panda/src/putil/mouseData.h @@ -37,6 +37,10 @@ PUBLISHED: void output(ostream &out) const; + MAKE_PROPERTY(x, get_x); + MAKE_PROPERTY(y, get_y); + MAKE_PROPERTY(in_window, get_in_window); + public: bool _in_window; double _xpos; diff --git a/panda/src/putil/paramValue.h b/panda/src/putil/paramValue.h index e1a4ca9cf0..f30be3da15 100644 --- a/panda/src/putil/paramValue.h +++ b/panda/src/putil/paramValue.h @@ -72,6 +72,8 @@ PUBLISHED: INLINE virtual TypeHandle get_value_type() const; INLINE TypedReferenceCount *get_value() const; + MAKE_PROPERTY(value, get_value); + virtual void output(ostream &out) const; private: @@ -118,6 +120,8 @@ PUBLISHED: INLINE void set_value(const Type &value); INLINE const Type &get_value() const; + MAKE_PROPERTY(value, get_value, set_value); + INLINE virtual void output(ostream &out) const; private: