]> git.donarmstrong.com Git - lilypond.git/blob - lily/spring-smob.cc
release: 1.5.38
[lilypond.git] / lily / spring-smob.cc
1 /*   
2   spring.cc --  implement Spring
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "spring.hh"
11 #include "debug.hh"
12 #include "ly-smobs.icc"
13
14 Spring_smob::Spring_smob()
15 {
16   distance_f_ =0.;
17   strength_f_ =1.0;
18   expand_only_b_ = false;
19   other_ = 0;
20 }
21
22
23 IMPLEMENT_SIMPLE_SMOBS(Spring_smob);
24
25 SCM
26 Spring_smob::mark_smob (SCM) { return SCM_UNSPECIFIED; }
27
28 int
29 Spring_smob::print_smob (SCM s, SCM p, scm_print_state *)
30 {
31   Spring_smob *ss = unsmob_spring (s);
32   scm_puts (_f("#<spring smob d= %f>", ss->distance_f_).ch_C(), p);
33   return 1;
34 }
35
36 SCM
37 Spring_smob::equal_p (SCM a , SCM b)
38 {
39   return a==b? SCM_BOOL_T : SCM_BOOL_F;
40 }
41
42 SCM
43 Spring_smob::smobbed_copy ()const
44 {
45   Spring_smob *  p = new Spring_smob (*this);
46   return p->smobbed_self ();
47 }