]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/balloon.cc
* lily/note-column.cc (dir): idem.
[lilypond.git] / lily / balloon.cc
index 5421c05a900c9360032724963a1bf57464322565..20508d8db3598a13c03125624d91a7f7721ca72c 100644 (file)
@@ -3,36 +3,35 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "text-item.hh"
+#include "text-interface.hh"
 #include "grob.hh"
 #include "line-interface.hh"
 #include "lookup.hh"
 #include "font-interface.hh"
-#include "stencil.hh"
 #include "lily-guile.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "misc.hh"
 
 class Balloon_interface
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 MAKE_SCHEME_CALLBACK (Balloon_interface, print, 1);
 SCM
-Balloon_interface::print (SCM smob) 
+Balloon_interface::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
   SCM cb = me->get_property ("balloon-original-callback");
   SCM stil = SCM_EOL;
 
-  if (ly_c_procedure_p (cb))
+  if (ly_is_procedure (cb))
     stil = scm_call_1 (cb, smob);
 
   if (!unsmob_stencil (stil))
@@ -55,16 +54,16 @@ Balloon_interface::print (SCM smob)
   Stencil fr = Lookup::frame (box_extent, 0.1, 0.05);
 
   fr.add_stencil (*s);
-  
+
   SCM bt = me->get_property ("balloon-text");
   SCM chain = Font_interface::text_font_alist_chain (me);
   chain = scm_cons (me->get_property ("balloon-text-props"), chain);
 
-  SCM text = Text_item::interpret_markup (me->get_paper ()->self_scm (),
-                                         chain, bt);
+  SCM text = Text_interface::interpret_markup (me->get_layout ()->self_scm (),
+                                              chain, bt);
 
   Stencil *text_stil = unsmob_stencil (text);
+
   Offset z1;
   for (int i = X_AXIS; i < NO_AXES; i++)
     {
@@ -74,17 +73,17 @@ Balloon_interface::print (SCM smob)
     }
 
   Offset z2 = z1 + off;
+
   fr.add_stencil (Line_interface::line (me, z1, z2));
 
   text_stil->translate (z2);
   fr.add_stencil (*text_stil);
-  fr = Stencil (orig_extent, fr.get_expr ());
+
+  fr = Stencil (orig_extent, fr.expr ());
   return fr.smobbed_copy ();
 }
 
-ADD_INTERFACE (Balloon_interface,"text-balloon-interface",
+ADD_INTERFACE (Balloon_interface, "text-balloon-interface",
               "A collection of routines to put text balloons around an object.",
               "balloon-padding balloon-text-props balloon-text-offset balloon-text balloon-original-callback");