]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/side-position-interface.cc
send_stream_event(...); macro should only produce one statement
[lilypond.git] / lily / side-position-interface.cc
index 08ac17285d4b9b1c6fa5bf7805a3a9609e4b1ba8..2e4591153a2a8af143c4630fad4f4ba0e31ab4e0 100644 (file)
@@ -24,7 +24,6 @@
 #include <set>
 #include <map>
 
-using namespace std;
 
 #include "accidental-interface.hh"
 #include "accidental-placement.hh"
@@ -48,6 +47,10 @@ using namespace std;
 #include "warn.hh"
 #include "unpure-pure-container.hh"
 
+using std::set;
+using std::string;
+using std::vector;
+
 void
 Side_position_interface::add_support (Grob *me, Grob *e)
 {
@@ -65,7 +68,7 @@ get_support_set (Grob *me)
 
   for (vsize i = 0; i < proto_support.size (); i++)
     {
-      if (Accidental_placement::has_interface (proto_support[i]))
+      if (has_interface<Accidental_placement> (proto_support[i]))
         {
           Grob *accs = proto_support[i];
           for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs);
@@ -252,7 +255,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
         continue; // so 'me' may not move in response to 'e'
 
       if (a == Y_AXIS
-          && Stem::has_interface (e))
+          && has_interface<Stem> (e))
         {
           // If called as 'pure' we may not force a stem to set its direction,
           if (pure && !is_direction (e->get_property_data ("direction")))
@@ -283,7 +286,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
                          : e->maybe_pure_coordinate (common[Y_AXIS], Y_AXIS, pure, start, end);
                Skyline_pair copy = *unsmob<Skyline_pair> (sp);
                if (a == Y_AXIS
-                   && Stem::has_interface (e)
+                   && has_interface<Stem> (e)
                    && to_boolean (me->get_maybe_pure_property ("add-stem-support", pure, start, end)))
                  copy[dir].set_minimum_height (copy[dir].max_height ());
                copy.shift (a == X_AXIS ? yc : xc);
@@ -344,7 +347,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
     total_off = minimum_space * dir;
 
   if (current_off)
-    total_off = dir * max (dir * total_off,
+    total_off = dir * std::max (dir * total_off,
                            dir * (*current_off));
 
   /* FIXME: 1000 should relate to paper size.  */
@@ -381,7 +384,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
           staff_span.widen (1);
           if (staff_span.contains (position)
               /* If we are between notehead and staff, quantize for ledger lines. */
-              || (Note_head::has_interface (head)
+              || (has_interface<Note_head> (head)
                   && dir * position < 0))
             {
               total_off += (rounded - position) * 0.5 * ss;
@@ -403,7 +406,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
           Real diff = (dir * staff_extent[dir] + staff_padding
                        - dir * total_off
                        + dir * (staff_position - parent_position));
-          total_off += dir * max (diff, 0.0);
+          total_off += dir * std::max (diff, 0.0);
         }
     }
   return scm_from_double (total_off);