define_implementations.h File Reference

Go to the source code of this file.

Defines

#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
  Define an equal operator (i.e. '==') for maxscript visible values.
#define  def_ne_op(_class, comparison_method, _member)
  Define a NOT equal operator (i.e. '!=') for maxscript visible values.
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)
#define  def_generic(fn, name)   Value* fn##_vf(Value** arglist, int arg_count)
#define  def_visible_generic(fn, name)   def_generic(fn, name)
#define  def_struct_generic(fn, name)   def_generic(fn, name)
#define  def_node_generic(fn, name)   def_generic(fn, name)
#define  def_mapped_generic(fn, name)   def_generic(fn, name)
#define  use_generic(fn, name)   def_generic(fn, name)
#define  def_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_visible_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_struct_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_node_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_mapped_generic_debug_ok(fn, name)   def_generic(fn, name)
#define  def_primitive(fn, name)
#define  def_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_lazy_primitive(fn, name)   def_primitive(fn, name)
#define  def_visible_primitive(fn, name)   def_primitive(fn, name)
#define  def_mapped_primitive(fn, name)   def_primitive(fn, name)
#define  def_struct_primitive(fn, _struct, name)   def_primitive(fn, name)
#define  def_primitive_debug_ok(fn, name)
#define  def_visible_primitive_debug_ok(fn, name)
#define  def_mapped_primitive_debug_ok(fn, name)
#define  def_lazy_primitive_debug_ok(fn, name)
#define  def_visible_lazy_primitive_debug_ok(fn, name)
#define  def_struct_primitive_debug_ok(fn, _struct, name)
#define  def_property(p)
#define  def_prop_getter(p)   Value* get_##p(Value** arg_list, int count)
#define  def_prop_setter(p)   Value* set_##p(Value** arg_list, int count)
#define  def_property_alias(p, real_p)
#define  def_2_prop_path(p1, p2)
#define  def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define  def_nested_prop(p1)
#define  def_backpatched_setter(_prop, _superclass)
#define  def_local_prop_alias(p, real_p)
#define  def_time_fn(_fn)   Value* _fn##_vf(Value** arglist, int arg_count)
#define  def_name(name)   n_##name = Name::intern(_M(#name));
#define  def_marker(var, str)
#define  _def_num_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_bin_op(_class, _conv, _op_fn, _op, _member)
#define  _def_rel_op(_class, _conv, _op_fn, _rel_op, _member)
#define  def_eq_op(_class, comparison_method, _member)
#define  def_ne_op(_class, comparison_method, _member)
#define  _def_num_un_op(_class, _op_fn, _op, _member)
#define  _def_un_op(_class, _op_fn, _op, _member)
#define  def_bin_op(_class, _conv, _op_fn, _op)   _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define  def_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define  def_un_op(_class, _op_fn, _op)   _def_num_un_op(_class, _op_fn, _op, value)
#define  PI_double   (3.14159265358979323846)
#define  TWOPI_double   (6.28318530717958647652)
#define  HALFPI_double   (1.57079632679489661973)
#define  DEG_TO_RAD_double   (PI_double/180.0)
#define  RAD_TO_DEG_double   (180.0/PI_double)
#define  DegToRad_double(deg)   (((double)deg)*DEG_TO_RAD_double)
#define  RadToDeg_double(rad)   (((double)rad)*RAD_TO_DEG_double)
#define  DegToRad_float(deg)   DegToRad(deg)
#define  RadToDeg_float(rad)   RadToDeg(rad)
#define  def_math_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_float_trig_fn(_class, _outclass, _type, _conv, _fn)
#define  def_math_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_angle_trig_bin_fn(_class, _outclass, _type, _conv, _fn)
#define  def_num_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_prop_accessors(_class, _prop, _member, _type, _conv)
#define  def_fn_prop_accessors(_class, _prop, _getter, _setter)
#define  def_fn_prop_getter(_class, _prop, _getter)
#define  def_fn_prop_setter(_class, _prop, _setter)
#define  def_float_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define  def_int_prop_accessors(_class, _prop, _member)   def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define  def_point3_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define  def_angle_prop_accessors(_class, _prop, _member)   def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define  def_time_bin_op(_op_fn, _op)   _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define  def_time_rel_op(_op_fn, _rel_op)   _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define  def_time_un_op(_op_fn, _op)   _def_un_op(MSTime, _op_fn, _op, time)
#define  def_quat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, q)
#define  def_quat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define  def_quat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, q)
#define  def_new_quat_fn(_fn, _arg_count, _call)
#define  def_mut_quat_fn(_fn, _arg_count, _call)
#define  def_new_mat_fn(_fn, _arg_count, _call)
#define  def_mut_mat_fn(_fn, _arg_count, _call)
#define  def_mat_primitive(_fn, _arg_count, _call)
#define  def_mat_bin_op(_class, _conv, _op_fn, _op)   _def_bin_op(_class, _conv, _op_fn, _op, m)
#define  def_mat_rel_op(_class, _conv, _op_fn, _rel_op)   _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define  def_mat_un_op(_class, _op_fn, _op)   _def_un_op(_class, _op_fn, _op, m)
#define  def_bool_node_fns(name, getter, setter)
#define  def_bool_node_getter(name, getter)
#define  def_ulong_node_fns(name, getter, setter)
#define  def_color_node_fns(name, getter, setter)
#define  def_bool_node_noredraw_fns(name, getter, setter)
#define  def_ulong_node_noredraw_fns(name, getter, setter)
#define  def_color_node_noredraw_fns(name, getter, setter)

Define Documentation

#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)

Definition at line 54 of file objectsets.h.

#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)

Definition at line 56 of file objectsets.h.

#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)

Definition at line 57 of file objectsets.h.

#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)

Definition at line 58 of file objectsets.h.

#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)

Definition at line 59 of file objectsets.h.

#define use_generic (   fn,
  name 
)    def_generic(fn, name)

Definition at line 60 of file objectsets.h.

#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)

Definition at line 62 of file objectsets.h.

#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)

Definition at line 63 of file objectsets.h.

#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)

Definition at line 64 of file objectsets.h.

#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)

Definition at line 65 of file objectsets.h.

#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)

Definition at line 66 of file objectsets.h.

#define def_primitive (   fn,
  name 
)

Definition at line 68 of file objectsets.h.

#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)

Definition at line 69 of file objectsets.h.

#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)

Definition at line 70 of file objectsets.h.

#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)

Definition at line 71 of file objectsets.h.

#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)

Definition at line 72 of file objectsets.h.

#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)

Definition at line 73 of file objectsets.h.

#define def_primitive_debug_ok (   fn,
  name 
)

Definition at line 75 of file objectsets.h.

#define def_visible_primitive_debug_ok (   fn,
  name 
)

Definition at line 76 of file objectsets.h.

#define def_mapped_primitive_debug_ok (   fn,
  name 
)

Definition at line 77 of file objectsets.h.

#define def_lazy_primitive_debug_ok (   fn,
  name 
)

Definition at line 78 of file objectsets.h.

#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)

Definition at line 79 of file objectsets.h.

#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)

Definition at line 80 of file objectsets.h.

#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)

Definition at line 82 of file objectsets.h.

#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)

Definition at line 85 of file objectsets.h.

#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)

Definition at line 87 of file objectsets.h.

#define def_property_alias (   p,
  real_p 
)

Definition at line 89 of file objectsets.h.

#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)

Definition at line 90 of file objectsets.h.

#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)

Definition at line 93 of file objectsets.h.

#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)

Definition at line 94 of file objectsets.h.

#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };

Definition at line 98 of file objectsets.h.

#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \

Definition at line 107 of file objectsets.h.

#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)

Definition at line 114 of file objectsets.h.

#define def_name (   name )    n_##name = Name::intern(_M(#name));

Definition at line 118 of file objectsets.h.

#define def_marker (   var,
  str 
)

Definition at line 121 of file objectsets.h.

#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }

Definition at line 125 of file objectsets.h.

#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }

Definition at line 140 of file objectsets.h.

#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }

Definition at line 155 of file objectsets.h.

#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }

Define an equal operator (i.e. '==') for maxscript visible values.

Definition at line 168 of file objectsets.h.

#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }

Define a NOT equal operator (i.e. '!=') for maxscript visible values.

Definition at line 182 of file objectsets.h.

#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }

Definition at line 197 of file objectsets.h.

#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }

Definition at line 204 of file objectsets.h.

#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)

Definition at line 211 of file objectsets.h.

#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)

Definition at line 213 of file objectsets.h.

#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)

Definition at line 215 of file objectsets.h.

#define PI_double   (3.14159265358979323846)

Definition at line 218 of file objectsets.h.

#define TWOPI_double   (6.28318530717958647652)

Definition at line 219 of file objectsets.h.

#define HALFPI_double   (1.57079632679489661973)

Definition at line 220 of file objectsets.h.

#define DEG_TO_RAD_double   (PI_double/180.0)

Definition at line 222 of file objectsets.h.

#define RAD_TO_DEG_double   (180.0/PI_double)

Definition at line 223 of file objectsets.h.

#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)

Definition at line 224 of file objectsets.h.

#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)

Definition at line 225 of file objectsets.h.

#define DegToRad_float (   deg )    DegToRad(deg)

Definition at line 227 of file objectsets.h.

#define RadToDeg_float (   rad )    RadToDeg(rad)

Definition at line 228 of file objectsets.h.

#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }

Definition at line 230 of file objectsets.h.

#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }

Definition at line 238 of file objectsets.h.

#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }

Definition at line 246 of file objectsets.h.

#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }

Definition at line 254 of file objectsets.h.

#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }

Definition at line 263 of file objectsets.h.

#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }

Definition at line 272 of file objectsets.h.

#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }

Definition at line 286 of file objectsets.h.

#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }

Definition at line 300 of file objectsets.h.

#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }

Definition at line 314 of file objectsets.h.

#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }

Definition at line 321 of file objectsets.h.

#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)

Definition at line 330 of file objectsets.h.

#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)

Definition at line 333 of file objectsets.h.

#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())

Definition at line 336 of file objectsets.h.

#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))

Definition at line 339 of file objectsets.h.

#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)

Definition at line 342 of file objectsets.h.

#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)

Definition at line 344 of file objectsets.h.

#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)

Definition at line 346 of file objectsets.h.

#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)

Definition at line 349 of file objectsets.h.

#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)

Definition at line 351 of file objectsets.h.

#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)

Definition at line 353 of file objectsets.h.

#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }

Definition at line 356 of file objectsets.h.

#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }

Definition at line 364 of file objectsets.h.

#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }

Definition at line 373 of file objectsets.h.

#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }

Definition at line 381 of file objectsets.h.

#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }

Definition at line 390 of file objectsets.h.

#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)

Definition at line 398 of file objectsets.h.

#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)

Definition at line 400 of file objectsets.h.

#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)

Definition at line 402 of file objectsets.h.

#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }

Definition at line 408 of file objectsets.h.

#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }

Definition at line 419 of file objectsets.h.

#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }

Definition at line 429 of file objectsets.h.

#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }

Definition at line 440 of file objectsets.h.

#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }

Definition at line 461 of file objectsets.h.

#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }

Definition at line 471 of file objectsets.h.

#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }

Definition at line 481 of file objectsets.h.

#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }
#define def_generic (   fn,
  name 
)    Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic (   fn,
  name 
)    def_generic(fn, name)
#define use_generic (   fn,
  name 
)    def_generic(fn, name)
#define def_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_visible_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_struct_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_node_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_mapped_generic_debug_ok (   fn,
  name 
)    def_generic(fn, name)
#define def_primitive (   fn,
  name 
)
#define def_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_lazy_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_visible_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_mapped_primitive (   fn,
  name 
)    def_primitive(fn, name)
#define def_struct_primitive (   fn,
  _struct,
  name 
)    def_primitive(fn, name)
#define def_primitive_debug_ok (   fn,
  name 
)
#define def_visible_primitive_debug_ok (   fn,
  name 
)
#define def_mapped_primitive_debug_ok (   fn,
  name 
)
#define def_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_visible_lazy_primitive_debug_ok (   fn,
  name 
)
#define def_struct_primitive_debug_ok (   fn,
  _struct,
  name 
)
#define def_property (   p )
Value:
Value*  get_##p(Value** arg_list, int count);   \
            Value*  set_##p(Value** arg_list, int count)
#define def_prop_getter (   p )    Value* get_##p(Value** arg_list, int count)
#define def_prop_setter (   p )    Value* set_##p(Value** arg_list, int count)
#define def_property_alias (   p,
  real_p 
)
#define def_2_prop_path (   p1,
  p2 
)
Value:
Value*  get_##p1##_##p2(Value** arg_list, int count);   \
            Value*  set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias (   p1,
  p2,
  real_p1,
  real_p2 
)
#define def_nested_prop (   p1 )
Value:
Value*  get_nested_##p1(Value** arg_list, int count);   \
            Value*  set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter (   _prop,
  _superclass 
)
Value:
Value*                                                  \
            set_##_prop(Value** arg_list, int count)                \
            {                                                       \
                _superclass::set_##_prop(arg_list, count);          \
                back_patch();                                       \
                return arg_list[0];                                 \
            };
#define def_local_prop_alias (   p,
  real_p 
)
Value:
Value*  get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); }   \
            Value*  set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); }   \
#define def_time_fn (   _fn )    Value* _fn##_vf(Value** arglist, int arg_count)
#define def_name (   name )    n_##name = Name::intern(_M(#name));
#define def_marker (   var,
  str 
)
#define _def_num_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = _class::intern(_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_bin_op (   _class,
  _conv,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        one_value_local(widened);                               \
        Value *arg, *result;                                    \
        arg = arg_list[0];                                      \
        if (tag != arg->tag && ((vl.widened = widen_to(arg, arg_list)) != NULL))    \
            result = vl.widened->_op_fn##_vf(arg_list, 1);      \
        else                                                    \
            result = new _class (_member _op (arg_list[0])->_conv()); \
        pop_value_locals();                                     \
        return result;                                          \
    }
#define _def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        Value *cmpnd = arg_list[0], *result;                    \
        if (comparable(cmpnd))                                  \
            result = (_member _rel_op cmpnd->_conv()) ?         \
                        &true_value : &false_value;             \
        else                                                    \
            throw IncompatibleTypes(this, cmpnd);               \
        return result;                                          \
    }
#define def_eq_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::eq_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                &true_value : &false_value;                     \
        else                                                    \
            result = &false_value;                              \
        return result;                                          \
    }
#define def_ne_op (   _class,
  comparison_method,
  _member 
)
Value:
Value*                                                      \
    _class::ne_vf(Value** arg_list, int count)                  \
    {                                                           \
        Value* cmpnd = arg_list[0];                             \
        Value* result;                                          \
        if (comparable(cmpnd))                                  \
            result = (_member == cmpnd->comparison_method()) ?  \
                        &false_value : &true_value;             \
        else                                                    \
            result = &true_value;                               \
        return result;                                          \
    }
#define _def_num_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return _class::intern(_op _member);                     \
    }
#define _def_un_op (   _class,
  _op_fn,
  _op,
  _member 
)
Value:
Value*                                                      \
    _class::_op_fn##_vf(Value** arg_list, int count)            \
    {                                                           \
        return new _class (_op _member);                        \
    }
#define def_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op (   _class,
  _op_fn,
  _op 
)    _def_num_un_op(_class, _op_fn, _op, value)
#define PI_double   (3.14159265358979323846)
#define TWOPI_double   (6.28318530717958647652)
#define HALFPI_double   (1.57079632679489661973)
#define DEG_TO_RAD_double   (PI_double/180.0)
#define RAD_TO_DEG_double   (180.0/PI_double)
#define DegToRad_double (   deg )    (((double)deg)*DEG_TO_RAD_double)
#define RadToDeg_double (   rad )    (((double)rad)*RAD_TO_DEG_double)
#define DegToRad_float (   deg )    DegToRad(deg)
#define RadToDeg_float (   rad )    RadToDeg(rad)
#define def_math_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                              \
    _class::_fn##_vf(Value** arg_list, int count)       \
    {                                                   \
        check_arg_count(_fn, 1, count+1);               \
        return _outclass::intern((_type)_fn(_conv()));      \
    }
#define def_angle_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv()))); \
    }
#define def_float_trig_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 1, count+1);                           \
        return _outclass::intern((_type)_fn(DegToRad_##_type(_conv()))); \
    }
#define def_math_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                      \
    _class::_fn##_vf(Value** arg_list, int count)               \
    {                                                           \
        check_arg_count(_fn, 2, count+1);                       \
        return _outclass::intern((_type)_fn(_conv(),                \
                              arg_list[0]->_conv()));           \
    }
#define def_angle_trig_bin_fn (   _class,
  _outclass,
  _type,
  _conv,
  _fn 
)
Value:
Value*                                                          \
    _class::_fn##_vf(Value** arg_list, int count)                   \
    {                                                               \
        check_arg_count(_fn, 2, count+1);                           \
        return _outclass::intern(RadToDeg_##_type((_type)_fn(_conv(),   \
                              arg_list[0]->_conv())));              \
    }
#define def_num_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _type::intern(_member);                              \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_prop_accessors (   _class,
  _prop,
  _member,
  _type,
  _conv 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return new _type (_member);                                 \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _member = val->_conv();                                     \
        return val;                                                 \
    }
#define def_fn_prop_accessors (   _class,
  _prop,
  _getter,
  _setter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }                                                               \
    Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_fn_prop_getter (   _class,
  _prop,
  _getter 
)
Value:
Value*                                                          \
    _class::get_##_prop(Value** arg_list, int count)                \
    {                                                               \
        return _getter;                                             \
    }
#define def_fn_prop_setter (   _class,
  _prop,
  _setter 
)
Value:
Value*                                                          \
    _class::set_##_prop(Value** arg_list, int count)                \
    {                                                               \
        Value*  val = arg_list[0];                                  \
        _setter;                                                    \
        return val;                                                 \
    }
#define def_float_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors (   _class,
  _prop,
  _member 
)    def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors (   _class,
  _prop,
  _member 
)    def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op (   _op_fn,
  _op 
)    _def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op (   _op_fn,
  _rel_op 
)    _def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op (   _op_fn,
  _op 
)    _def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new QuatValue (_call);                       \
    }
#define def_mut_quat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    QuatValue::_fn##_vf(Value** arg_list, int count)        \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_new_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        return new Matrix3Value (_call);                        \
    }
#define def_mut_mat_fn (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    Matrix3Value::_fn##_vf(Value** arg_list, int count)     \
    {                                                       \
        check_arg_count(_fn, _arg_count, count + 1);        \
        _call;                                              \
        return this;                                        \
    }
#define def_mat_primitive (   _fn,
  _arg_count,
  _call 
)
Value:
Value*                                                  \
    _fn##_cf(Value** arg_list, int count)                   \
    {                                                       \
        check_arg_count(_fn, _arg_count, count);            \
        return new Matrix3Value (_call);                    \
    }
#define def_mat_bin_op (   _class,
  _conv,
  _op_fn,
  _op 
)    _def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op (   _class,
  _conv,
  _op_fn,
  _rel_op 
)    _def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op (   _class,
  _op_fn,
  _op 
)    _def_un_op(_class, _op_fn, _op, m)
#define def_bool_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_getter (   name,
  getter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        throw RuntimeError (_M("Property not settable: "), #name);                              \
    }
#define def_ulong_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_color_node_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
        InvalidateNodeRect((INode*)obj,t);                                                      \
    }
#define def_bool_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return ((INode*)obj)->getter() ? &true_value : &false_value;                            \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter(val->to_bool());                                                  \
    }
#define def_ulong_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        return Integer::intern((int)((INode*)obj)->getter());                                   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        ((INode*)obj)->setter((ULONG)val->to_int());                                            \
    }
#define def_color_node_noredraw_fns (   name,
  getter,
  setter 
)
Value:
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)     \
    {                                                                                           \
        DWORD rgb = ((INode*)obj)->getter();                                                    \
        return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f);   \
    }                                                                                           \
    void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val)            \
    {                                                                                           \
        AColor c;                                                                               \
        c = val->to_acolor();                                                                   \
        ((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255)));    \
    }