]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4082/3: Run scripts/auxiliar/smob-convert.sh
authorDavid Kastrup <dak@gnu.org>
Wed, 27 Aug 2014 19:12:55 +0000 (21:12 +0200)
committerDavid Kastrup <dak@gnu.org>
Mon, 1 Sep 2014 13:11:34 +0000 (15:11 +0200)
78 files changed:
lily/book-scheme.cc
lily/book.cc
lily/box.cc
lily/context-def.cc
lily/context-mod.cc
lily/context-property.cc
lily/context.cc
lily/dispatcher.cc
lily/duration.cc
lily/font-metric.cc
lily/grob-array.cc
lily/grob-smob.cc
lily/grob.cc
lily/include/book.hh
lily/include/box.hh
lily/include/context-def.hh
lily/include/context-mod.hh
lily/include/context.hh
lily/include/dispatcher.hh
lily/include/duration.hh
lily/include/font-metric.hh
lily/include/grob-array.hh
lily/include/grob.hh
lily/include/lily-lexer.hh
lily/include/lily-parser.hh
lily/include/listener.hh
lily/include/moment.hh
lily/include/music-iterator.hh
lily/include/music-output.hh
lily/include/output-def.hh
lily/include/page-marker.hh
lily/include/paper-book.hh
lily/include/paper-outputter.hh
lily/include/pitch.hh
lily/include/prob.hh
lily/include/scale.hh
lily/include/scheme-listener.hh
lily/include/scm-hash.hh
lily/include/score.hh
lily/include/simple-spacer.hh
lily/include/skyline-pair.hh
lily/include/skyline.hh
lily/include/source-file.hh
lily/include/spring.hh
lily/include/stencil.hh
lily/include/translator-dispatch-list.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/input-smob.cc
lily/lily-lexer.cc
lily/lily-parser.cc
lily/listener.cc
lily/moment.cc
lily/music-function.cc
lily/music-iterator.cc
lily/music-output.cc
lily/music.cc
lily/output-def.cc
lily/page-marker.cc
lily/paper-book.cc
lily/paper-outputter.cc
lily/pitch.cc
lily/prob.cc
lily/scale.cc
lily/scheme-listener.cc
lily/scm-hash.cc
lily/score.cc
lily/simple-spacer.cc
lily/skyline-pair.cc
lily/skyline.cc
lily/source-file.cc
lily/spring-smob.cc
lily/stencil.cc
lily/stream-event.cc
lily/translator-dispatch-list.cc
lily/translator-group.cc
lily/translator.cc
lily/undead.cc

index 719f1e6b223722afdd85bf9d5346a54ca6a33b41..e7bae34f7cafb0b726ec2fc8e5ddae6c77b8439a 100644 (file)
@@ -178,6 +178,5 @@ LY_DEFINE (ly_book_scores, "ly:book-scores",
   return b->scores_;
 }
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_TYPE_P (Book, "ly:book?");
+const char Book::type_p_name_[] = "ly:book?";
index a13a3ca51d0d9a25a3b2f4f49472a437f40cd351..876a93876e6cb39a0f3b9f6e1513d4609a715b62 100644 (file)
@@ -33,7 +33,6 @@ using namespace std;
 #include "paper-score.hh"
 #include "page-marker.hh"
 
-#include "ly-smobs.icc"
 
 Book::Book ()
 {
@@ -105,8 +104,6 @@ Book::~Book ()
 {
 }
 
-IMPLEMENT_SMOBS (Book);
-IMPLEMENT_DEFAULT_EQUAL_P (Book);
 
 SCM
 Book::mark_smob (SCM s)
index 68d53b39f69b73e2cf5c783ea96795c552ee3e47..700eec3a6c8e9a7d3ecc39fc392bcd07c91f3d85 100644 (file)
@@ -132,21 +132,5 @@ Box::print ()
 
 /****************************************************************/
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SIMPLE_SMOBS (Box);
-IMPLEMENT_TYPE_P (Box, "ly:box?");
-IMPLEMENT_DEFAULT_EQUAL_P (Box);
-
-SCM
-Box::mark_smob (SCM /* x */)
-{
-  return SCM_EOL;
-}
-
-int
-Box::print_smob (SCM /* x */, SCM p, scm_print_state *)
-{
-  scm_puts ("#<Box>", p);
-  return 1;
-}
+const char Box::type_p_name_[] = "ly:box?";
index 4df8e5e1599dae1f96e949e632cd108e331496db..3ebc45d2a273f9d931b91294777673c053c5798d 100644 (file)
@@ -81,10 +81,7 @@ Context_def::~Context_def ()
 {
 }
 
-#include "ly-smobs.icc"
-IMPLEMENT_SMOBS (Context_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Context_def);
-IMPLEMENT_TYPE_P (Context_def, "ly:context-def?");
+const char Context_def::type_p_name_[] = "ly:context-def?";
 
 int
 Context_def::print_smob (SCM smob, SCM port, scm_print_state *)
index 2d35e05f836b31278e5a376b8c8d0416c2e07c09..398735900c939f108a1ee0f2eccecccb676eca4c 100644 (file)
@@ -34,10 +34,7 @@ Context_mod::Context_mod (SCM mod_list)
   mods_ = scm_reverse (mod_list);
 }
 
-#include "ly-smobs.icc"
-IMPLEMENT_SIMPLE_SMOBS (Context_mod);
-IMPLEMENT_DEFAULT_EQUAL_P (Context_mod);
-IMPLEMENT_TYPE_P (Context_mod, "ly:context-mod?");
+const char Context_mod::type_p_name_[] = "ly:context-mod?";
 
 int
 Context_mod::print_smob (SCM smob, SCM port, scm_print_state *)
@@ -78,4 +75,3 @@ Context_mod::get_mods () const
 {
   return scm_reverse (mods_);
 }
-
index d7584d1381f973766358d02c155e3970e139f4a1..07d512d6e3a39b47afe818a5f023f82d14f7b264 100644 (file)
@@ -63,8 +63,13 @@ typecheck_grob (SCM symbol, SCM value)
     || type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?"));
 }
 
-class Grob_properties
+class Grob_properties : public Simple_smob<Grob_properties>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+private:
   friend class Grob_property_info;
   friend SCM ly_make_grob_properties (SCM);
   // alist_ may contain unexpanded nested overrides
@@ -88,13 +93,9 @@ class Grob_properties
     // order to trigger an initial update.  But this should never
     // happen, so we initialize straight with alist.
     cooked_ (alist), cooked_from_ (alist), nested_ (0) { }
-  DECLARE_SIMPLE_SMOBS (Grob_properties);
 };
 
-#include "ly-smobs.icc"
-IMPLEMENT_SIMPLE_SMOBS (Grob_properties);
-IMPLEMENT_DEFAULT_EQUAL_P (Grob_properties);
-IMPLEMENT_TYPE_P (Grob_properties, "ly:grob-properties?");
+const char Grob_properties::type_p_name_[] = "ly:grob-properties?";
 
 SCM
 Grob_properties::mark_smob (SCM smob)
index 718ef311225dfb0062e8e079990231496a49fbfd..5aacffc4eb552d8c77e17f6161dcf89b3604a7cc 100644 (file)
@@ -23,7 +23,6 @@
 #include "dispatcher.hh"
 #include "global-context.hh"
 #include "international.hh"
-#include "ly-smobs.icc"
 #include "main.hh"
 #include "output-def.hh"
 #include "profile.hh"
@@ -715,9 +714,7 @@ Context::mark_smob (SCM sm)
   return me->properties_scm_;
 }
 
-IMPLEMENT_SMOBS (Context);
-IMPLEMENT_DEFAULT_EQUAL_P (Context);
-IMPLEMENT_TYPE_P (Context, "ly:context?");
+const char Context::type_p_name_[] = "ly:context?";
 
 Global_context *
 Context::get_global_context () const
index 5f0e38007e41d8dd4989304b7906b7bc35a01a46..2e537307919c2be900f8544b74dae2535cb7a1b0 100644 (file)
 #include "dispatcher.hh"
 #include "input.hh"
 #include "international.hh"
-#include "ly-smobs.icc"
 #include "warn.hh"
 
-IMPLEMENT_SMOBS (Dispatcher);
-IMPLEMENT_TYPE_P (Dispatcher, "ly:dispatcher?");
-IMPLEMENT_DEFAULT_EQUAL_P (Dispatcher);
+const char Dispatcher::type_p_name_[] = "ly:dispatcher?";
 
 Dispatcher::~Dispatcher ()
 {
index 894748f915788a9387add5c8ad5fdeb39d31e9cb..afc615cdb04b35de7da997354061e556e6fd7473 100644 (file)
@@ -23,7 +23,6 @@
 #include "misc.hh"
 #include "lily-proto.hh"
 
-#include "ly-smobs.icc"
 
 int
 Duration::compare (Duration const &left, Duration const &right)
@@ -137,15 +136,9 @@ Duration::to_string () const
   return s;
 }
 
-IMPLEMENT_TYPE_P (Duration, "ly:duration?");
+const char Duration::type_p_name_[] = "ly:duration?";
 
-SCM
-Duration::mark_smob (SCM)
-{
-  return SCM_EOL;
-}
 
-IMPLEMENT_SIMPLE_SMOBS (Duration);
 int
 Duration::print_smob (SCM s, SCM port, scm_print_state *)
 {
index f12fc4ed2c29bce41238324ebb376229edafb76e..ab0f8f47e36a7a4c53e6e546836c73276a63c107 100644 (file)
@@ -29,7 +29,6 @@ using namespace std;
 #include "stencil.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
 Real
 Font_metric::design_size () const
@@ -114,9 +113,7 @@ Font_metric::print_smob (SCM s, SCM port, scm_print_state *)
   return 1;
 }
 
-IMPLEMENT_SMOBS (Font_metric);
-IMPLEMENT_DEFAULT_EQUAL_P (Font_metric);
-IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?");
+const char Font_metric::type_p_name_[] = "ly:font-metric?";
 
 SCM
 Font_metric::font_file_name () const
index 78ee5eff006986abb095505837fe245e8c02800e..593ce6a568462236441fbabda7109c5197e13b2f 100644 (file)
@@ -21,7 +21,6 @@
 #include "item.hh"
 #include "spanner.hh"
 
-#include "ly-smobs.icc"
 
 Item *
 Grob_array::item (vsize i)
@@ -113,10 +112,8 @@ Grob_array::set_array (vector<Grob *> const &src)
   grobs_ = src;
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Grob_array);
-IMPLEMENT_TYPE_P (Grob_array, "ly:grob-array?");
+const char Grob_array::type_p_name_[] = "ly:grob-array?";
 
-IMPLEMENT_DEFAULT_EQUAL_P (Grob_array);
 
 SCM
 grob_list_to_grob_array (SCM lst)
index a201c800438b21fdc262224892bedbb4e3b11a2c..eaec5420c23e1b084131f6ec9575e2e39fd00469 100644 (file)
 #include "paper-score.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS (Grob);
-IMPLEMENT_DEFAULT_EQUAL_P (Grob);
-IMPLEMENT_TYPE_P (Grob, "ly:grob?");
+const char Grob::type_p_name_[] = "ly:grob?";
 
 SCM
 Grob::mark_smob (SCM ses)
index c45dd09b2765f27298bda75ad7d62c689f5748af..eeb219e244f0c0835ab20c517e137b0f85ded724 100644 (file)
@@ -39,7 +39,6 @@
 #include "unpure-pure-container.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
 Grob *
 Grob::clone () const
index 7527cf5062c2780c758cb5329c1da811434e3486..eb0a105f86d83196b32a0cdd8ed2f66ce57fe6e6 100644 (file)
 #include "virtual-methods.hh"
 #include "smobs.hh"
 
-class Book
+class Book : public Smob<Book>
 {
-  DECLARE_SMOBS (Book);
-
 public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Book ();
   SCM header_;
   Output_def *paper_;
   SCM scores_;
index 685fbcff75a61fe3912134c75dfeaf4e23581df9..7d5745d6965b757123606d33b4b25edf64dc1779 100644 (file)
@@ -9,10 +9,12 @@
 #include "offset.hh"
 #include "smobs.hh"
 
-class Box
+class Box : public Simple_smob<Box>
 {
+public:
+  static const char type_p_name_[];
+private:
   Interval interval_a_[NO_AXES];
-  DECLARE_SIMPLE_SMOBS (Box);
 public:
   Interval &x () {return interval_a_[X_AXIS]; }
   Interval &y () { return interval_a_[Y_AXIS]; }
index ecf1cb0c42d3040c2ea83aea7b48b581a249a707..258d07ba92d6de226a40f9770ff297a317202195 100644 (file)
   The definition of an interpretation context as given in the
   input. The lists are stored in order of definition.
 */
-struct Context_def
+struct Context_def : public Smob<Context_def>
 {
+  static SCM mark_smob (SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
+  virtual ~Context_def ();
 private:
   /*
     these lists store the definition, in opposite order of entry
@@ -76,11 +80,9 @@ public:
   void apply_default_property_operations (Context *);
 
 private:
-  DECLARE_SMOBS (Context_def);
   Context_def ();
   Context_def (Context_def const &);
 };
 
 
 #endif /* CONTEXT_DEF_HH */
-
index 44ba8d2ebc628a31785593bf00bdf1711c9ec166..424f06a8ecdebe5b7fe8d1516798f07ae08a7b51 100644 (file)
   Modifications for an interpretation context as given in the
   input.
 */
-struct Context_mod
+struct Context_mod : public Simple_smob<Context_mod>
 {
+  static SCM mark_smob (SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
 private:
   SCM mods_;
 public:
@@ -47,9 +50,7 @@ public:
   Context_mod ();
   Context_mod (Context_mod const &);
   Context_mod (SCM mod_list);
-  DECLARE_SIMPLE_SMOBS (Context_mod);
 };
 
 
 #endif /* CONTEXT_MOD_HH */
-
index c8bea9fad98c571201f25fb52433cc13f56be71a..ab406c9041623d48e88b9aa8a9b9d24aac1a3122 100644 (file)
 #include "std-vector.hh"
 #include "virtual-methods.hh"
 
-class Context
+class Context : public Smob<Context>
 {
+public:
+  static SCM mark_smob (SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
+  virtual ~Context ();
+private:
   Scheme_hash_table *properties_dict () const;
   Context (Context const &src);
 
-  DECLARE_SMOBS (Context);
   DECLARE_CLASSNAME (Context);
   void terminate ();
 
index 1d3583bb673f2a7faaf588feeee90c7133a44f8c..2be14d91777425f0080ccb6a73c29ce44ea01e42 100644 (file)
 #include "listener.hh"
 #include "stream-event.hh"
 
-class Dispatcher
+class Dispatcher : public Smob<Dispatcher>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Dispatcher ();
+private:
   /* Hash table. Each event-class maps to a list of listeners. */
   SCM listeners_;
   /* alist of dispatchers that we listen to. Each entry is a
@@ -45,8 +51,6 @@ public:
   void remove_listener (Listener, SCM event_class);
   void register_as_listener (Dispatcher *dist);
   void unregister_as_listener (Dispatcher *dist);
-protected:
-  DECLARE_SMOBS (Dispatcher);
 };
 
 
index 959ed09e1be5edb137bb776357ddb93f4bfe22da..1eed866409c99c13d341698cffa498066b5c4e0a 100644 (file)
 /**
    A musical duration.
 */
-struct Duration
+struct Duration : public Simple_smob<Duration>
 {
-public:
-
+  static SCM equal_p (SCM, SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
   Duration ();
   Duration (int, int);
   Duration (Rational, bool scale);
@@ -43,7 +44,6 @@ public:
   static int compare (Duration const &, Duration const &);
 
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
-  DECLARE_SIMPLE_SMOBS (Duration);
 
 private:
   /// Logarithm of the base duration.
@@ -58,4 +58,3 @@ INSTANTIATE_COMPARE (Duration, Duration::compare);
 extern SCM Duration_type_p_proc;
 
 #endif // DURATION_HH
-
index 720f33b8375799f47110dfe07f8cc12553e2006e..0eb2e0808bd9afc91e9bfae1658cbc99bab0bccc 100644 (file)
 
 typedef std::map<FT_UInt, FT_ULong> Index_to_charcode_map;
 
-class Font_metric
+class Font_metric : public Smob<Font_metric>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Font_metric ();
+private:
   DECLARE_CLASSNAME (Font_metric);
 
 public:
@@ -54,7 +60,6 @@ public:
   virtual Stencil find_by_name (string) const;
   virtual SCM sub_fonts () const;
   virtual SCM font_file_name () const;
-  DECLARE_SMOBS (Font_metric);
 
 private:
   /* No copying, no implicit copy constructor.  */
index 33d458cea8c0c1f378667873af58b289f79444a0..feeda8a36a23c43831ee11a1f7f3d39e39568bb9 100644 (file)
 #include "smobs.hh"
 #include "std-vector.hh"
 
-class Grob_array
+class Grob_array : public Simple_smob<Grob_array>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+private:
   vector<Grob *> grobs_;
   bool ordered_;
 
-  DECLARE_SIMPLE_SMOBS (Grob_array);
 
   Grob_array ();
 public:
@@ -55,4 +59,3 @@ SCM grob_list_to_grob_array (SCM lst);
 SCM grob_array_to_list (Grob_array *array);
 
 #endif /* GROB_ARRAY_HH */
-
index 2aec0fa90906c482188a6a17597af8afda7dbd26..ae2a9a20a1eb4dead148333203a36268efe22046 100644 (file)
 
 #include <set>
 
-class Grob
+class Grob : public Smob<Grob>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Grob ();
 private:
-  DECLARE_SMOBS (Grob);
   DECLARE_CLASSNAME (Grob);
 
   void init ();
index 10dbc48389e0aaee5ca2158aa7d64b77d406c06e..050e01f525b79261ef0df705917fe6d64f427aa3 100644 (file)
@@ -31,10 +31,13 @@ bool busy_parsing ();
 void kill_lexer ();
 void set_lexer ();
 
-class Lily_lexer : public Includable_lexer
+class Lily_lexer : public Smob<Lily_lexer>, public Includable_lexer
 {
-  DECLARE_SMOBS (Lily_lexer);
-
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Lily_lexer ();
 private:
   int lookup_keyword (const string&);
   int scan_bare_word (const string&);
index 305d439ee2a0e68ae399c5db5658d3c91c6a673c..2ea3b0c6dcdaff87d68342fd16fa785c8bf31888 100644 (file)
 
    TODO: interface is too complicated
 */
-class Lily_parser
+class Lily_parser : public Smob<Lily_parser>
 {
-  DECLARE_SMOBS (Lily_parser);
-
 public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Lily_parser ();
   Lily_lexer *lexer_;
   Sources *sources_;
   Duration default_duration_;
index 51ad5db821d30885303cb72e9ef787b12720efb9..38b11b2d3452e5146e82da311dc77b7265cd2d50 100644 (file)
@@ -70,8 +70,14 @@ typedef struct
   bool (*equal_callback) (void *, void *);
 } Listener_function_table;
 
-class Listener
+class Listener : public Simple_smob<Listener>
 {
+public:
+  static SCM equal_p (SCM, SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+private:
   void *target_;
   Listener_function_table *type_;
 public:
@@ -87,7 +93,6 @@ public:
            && (*type_->equal_callback) ((void *) target_, (void *) other.target_);
   }
 
-  DECLARE_SIMPLE_SMOBS (Listener);
 };
 
 #define IMPLEMENT_LISTENER(cl, method)                  \
index 2f53c9e2582429f671c8c487818188060b36723b..da3542f964ea39ad9812c56267534f6f66b7847b 100644 (file)
    Musical timing (Main-timing, grace-timing) with glue for
    Guilification;
 */
-class Moment
+class Moment : public Simple_smob<Moment>
 {
-  DECLARE_SIMPLE_SMOBS (Moment);
 public:
+  static SCM equal_p (SCM, SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
   Moment ();
   Moment (int m);
 
@@ -80,4 +82,3 @@ ostream &operator << (ostream &, Moment const &);
 bool moment_less (SCM a, SCM b);
 
 #endif /* MOMENT_HH */
-
index 436318bd385dcda8effd8801147c0660c8101825..cf7d640626aacee684fb76282b7244a977b64c80 100644 (file)
 
    merge pending_moment and process?
 */
-class Music_iterator
+class Music_iterator : public Smob<Music_iterator>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Music_iterator ();
 protected:
   Moment music_length_;
   Moment start_mom_;
 
   DECLARE_CLASSNAME (Music_iterator);
-  DECLARE_SMOBS (Music_iterator);
   Music_iterator (Music_iterator const &);
 
 public:
index 73d2ac94c6f50733e8bef9bbb3abf79aaa36a264..685b764160fd5247b1361dd7ccab841a55c909d2 100644 (file)
 #include "smobs.hh"
 #include "virtual-methods.hh"
 
-class Music_output
+class Music_output : public Smob<Music_output>
 {
-  DECLARE_SMOBS (Music_output);
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Music_output ();
+private:
   DECLARE_CLASSNAME (Music_output);
 protected:
   Music_output ();
index e0091e3654b7aa016c100db6682f2cd5932dc0e3..1e572e6e3023f52ebbe7d0b678948551a89429fa 100644 (file)
   one coming from score at markup level)
   
  */
-class Output_def
+class Output_def : public Smob<Output_def>
 {
-
 public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  virtual ~Output_def ();
   VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
-  DECLARE_SMOBS (Output_def);
 
-public:
   SCM scope_;
   Output_def *parent_;
   
index 8f344d41affea574aca8c0b1b8104ad41afb3818..53c29d4f325bed706ddb2bb1dbae6e0669215be9 100644 (file)
 #include "smobs.hh"
 #include "virtual-methods.hh"
 
-class Page_marker
+class Page_marker : public Smob<Page_marker>
 {
-  DECLARE_SMOBS (Page_marker);
-
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Page_marker ();
+private:
   SCM symbol_; /* either 'page-turn-permission or 'page-break-permission */
   SCM permission_;  /* 'force, 'allow, or '() */
   SCM label_; /* bookmarking label (a symbol) */
index 42dc8c0065918bee7e44220200b54c2ff3d1d5a6..beca941da7d000f7c956d2118098ca7ebd8480b4 100644 (file)
     exports them to the output backend, either as systems or as
     completely formatted pages.  */
 
-class Paper_book
+class Paper_book : public Smob<Paper_book>
 {
-  DECLARE_SMOBS (Paper_book);
-
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Paper_book ();
+private:
   SCM systems_;
   SCM pages_;
   SCM performances_;
index b7dd8399bf20f89d5d8ee653b108a7ddd681292f..a156c382d9348b056320d2a9015af59eac9ba48d 100644 (file)
   Glue between the backend (grobs, systems, pages) and the output file.
   proxy for Scheme backends.
 */
-class Paper_outputter
+class Paper_outputter : public Smob<Paper_outputter>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  virtual ~Paper_outputter ();
+private:
   SCM output_module_;
   string file_name_;
   SCM file_;
 
-public:
-  DECLARE_SMOBS (Paper_outputter);
-
 public:
   Paper_outputter (SCM port, const string &format);
 
index 91c527455712cb4f6a1f388921d1328fc23d7530..e21f629b57164f135caf893cbe4a84b39e9c93a1 100644 (file)
   Pitch is lexicographically ordered by (octave, notename, alteration).
 */
 
-class Pitch
+class Pitch : public Simple_smob<Pitch>
 {
+public:
+  static SCM equal_p (SCM, SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
 private:
   int octave_;
   int notename_;
@@ -70,7 +75,6 @@ public:
   string to_string () const;
 
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
-  DECLARE_SIMPLE_SMOBS (Pitch);
 };
 
 enum
index 6fd7c49081e2ff992604ed7ab8a84a3e13cc0df4..eb19c8d79ab9cd6766ec2464d1597a1065a4c543 100644 (file)
   Property_object. Page-breaking handles Property_object objects.
 */
 
-class Prob
+class Prob : public Smob<Prob>
 {
-  DECLARE_SMOBS (Prob);
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static SCM equal_p (SCM, SCM);
+  static const char type_p_name_[];
+  virtual ~Prob ();
+private:
   DECLARE_CLASSNAME (Prob);
 
   void init_vars ();
index daaf0bb2dc6ca4c213ad96a32349872f5ef126a9..d3d132810b2d45976f68da318fd469c759c7c8c9 100644 (file)
@@ -24,9 +24,9 @@
 #include "rational.hh"
 #include "std-vector.hh"
 
-struct Scale
+struct Scale : public Smob<Scale>
 {
-public:
+  virtual ~Scale ();
   Scale (vector<Rational> const &);
   Scale (Scale const &);
 
@@ -35,7 +35,6 @@ public:
   int step_count () const;
   int normalize_step (int step) const;
 
-  DECLARE_SMOBS (Scale);
 
 private:
   vector<Rational> step_tones_;
@@ -44,4 +43,3 @@ private:
 extern Scale *default_global_scale;
 
 #endif /* SCALE_HH */
-
index 56ede65e7d2fce033505bedd06734b0018b8356d..b8e42ee9110a86cd833b2916b0ab4cc37e93d8c7 100644 (file)
 #define SCHEME_LISTENER_HH
 
 #include "listener.hh"
-#include "ly-smobs.icc"
 
 /*
  Scheme_listener is only used internally by scheme-listener-scheme.cc
 */
 
-class Scheme_listener
+class Scheme_listener : public Smob<Scheme_listener>
 {
 public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  virtual ~Scheme_listener ();
   Scheme_listener (SCM callback);
   DECLARE_LISTENER (call);
-protected:
-  DECLARE_SMOBS (Scheme_listener);
 private:
   SCM callback_;
 };
index 1182c503f9af5791e1fddf3301b049e5c09be680..1a15aff359ec247bef0eec46e483c8a656ae5c28 100644 (file)
   scm_gc_unprotect_object (tab->self_scm_);
 */
 
-class Scheme_hash_table
+class Scheme_hash_table : public Smob<Scheme_hash_table>
 {
 public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  virtual ~Scheme_hash_table ();
   bool try_retrieve (SCM key, SCM *val);
   bool contains (SCM key) const;
   void set (SCM k, SCM v);
@@ -59,8 +62,6 @@ public:
 private:
   SCM hash_tab_;
   void copy (Scheme_hash_table const &src);
-  DECLARE_SMOBS (Scheme_hash_table);
 };
 
 #endif /* SCM_HASH_HH */
-
index 8cc40c84cb169e12811fea9c1a7a1c3a78a18a53..15e32ab17390d6e2c40a1cadaef6761756d25751 100644 (file)
 #include "smobs.hh"
 #include "virtual-methods.hh"
 
-class Score
+class Score : public Smob<Score>
 {
-  DECLARE_SMOBS (Score);
-
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Score ();
+private:
   SCM music_;
   SCM input_location_;
   SCM header_;
index 71b1045acad3258367239265ab21403fe939fd22..32bf205e8694a2e0659e2a8cff37cda85d647573 100644 (file)
@@ -25,7 +25,7 @@
 #include "spring.hh"
 #include "smobs.hh"
 
-class Simple_spacer
+class Simple_spacer : public Simple_smob<Simple_spacer>
 {
 public:
   Simple_spacer ();
@@ -43,7 +43,6 @@ public:
   Real force_penalty (bool ragged) const;
   bool fits () const;
 
-  DECLARE_SIMPLE_SMOBS (Simple_spacer);
 
 private:
   Real expand_line ();
@@ -69,4 +68,3 @@ Column_x_positions get_line_configuration (vector<Grob *> const &columns,
                                            bool ragged);
 
 #endif /* SIMPLE_SPACER_HH */
-
index 0d37f794f4557d9e7dfb04a57d749afdabeb0585..26f2542e0a1b67625b3392bc9c8be6b127e3e75d 100644 (file)
 
 #include "skyline.hh"
 
-class Skyline_pair
+class Skyline_pair : public Simple_smob<Skyline_pair>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
 private:
   Drul_array<Skyline> skylines_;
 
-  DECLARE_SIMPLE_SMOBS (Skyline_pair);
 public:
   Skyline_pair ();
   Skyline_pair (vector<Box> const &boxes, Axis a);
index bdb8be78131f448921c1459413dae4b2417635c9..c3309700e68adb564b5f9d64dec2acdcbc62d84f 100644 (file)
@@ -49,8 +49,12 @@ struct Building
   Real shift_to_intersect (Real x, Real y) const;
 };
 
-class Skyline
+class Skyline : public Simple_smob<Skyline>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
 private:
   list<Building> buildings_;
   Direction sky_;
@@ -62,7 +66,6 @@ private:
   Real internal_distance (Skyline const &, Real *touch_point) const;
   void normalize ();
 
-  DECLARE_SIMPLE_SMOBS (Skyline);
 
 public:
   Skyline ();
@@ -107,4 +110,3 @@ public:
 extern bool debug_skylines;
 
 #endif /* SKYLINE_HH */
-
index 26bf6dbdb4810acb0df6b07a5f7a28bbf25d407e..7647ce3830320132f58f97cad03190109880fe62 100644 (file)
@@ -35,8 +35,14 @@ using namespace std;
    get_line (), get_word () here.
 */
 
-class Source_file
+class Source_file : public Smob<Source_file>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Source_file ();
+private:
   vector<char const *> newline_locations_;
   istream *istream_;
   vector<char> characters_;
@@ -46,7 +52,6 @@ class Source_file
   void init_port ();
   void init ();
 
-  DECLARE_SMOBS (Source_file);
 public:
   Source_file (const string &fn);
   Source_file (const string&, const string&);
@@ -61,7 +66,6 @@ public:
   string name_string () const;
   string file_line_column_string (char const *str0) const;
 
-public:
   Slice line_slice (char const *pos_str0) const;
   string line_string (char const *pos_str0) const;
   void get_counts (char const *pos_str0, int *, int *, int *, int *) const;
@@ -76,4 +80,3 @@ protected:
 vector<char> gulp_file (const string &fn, int desired);
 
 #endif /* SOURCE_FILE_HH */
-
index 1f6aa3b70cd8e22e54c086da79b772e9f19e3be3..ce3dbfd93b8bf16e779d21d9ece71d9090feea10 100644 (file)
 #include "lily-proto.hh"
 #include "smobs.hh"
 
-class Spring
+class Spring : public Simple_smob<Spring>
 {
+public:
+  static SCM equal_p (SCM, SCM);
+  static const char type_p_name_[];
+private:
   Real distance_;
   Real min_distance_;
 
@@ -35,7 +39,6 @@ class Spring
 
   void update_blocking_force ();
 
-  DECLARE_SIMPLE_SMOBS (Spring);
 public:
   Spring ();
   Spring (Real distance, Real min_distance);
@@ -65,4 +68,3 @@ public:
 Spring merge_springs (vector<Spring> const &springs);
 
 #endif /* SPRING_HH */
-
index cc8d750c1ffba583f35e3989cd9a3c52ee507e27..e91cfa97590c300f16b1efd50ceb4dde45fbe2af 100644 (file)
@@ -55,12 +55,16 @@ using namespace std;
 
     DIMENSIONS = (Interval (0, 0), Interval (0, 0)
 */
-class Stencil
+class Stencil : public Simple_smob<Stencil>
 {
+public:
+  static SCM mark_smob (SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
+private:
   Box dim_;
   SCM expr_;
 
-  DECLARE_SIMPLE_SMOBS (Stencil);
 public:
   Stencil (Box, SCM s);
   Stencil ();
index bdb9e57ef30bfd0e8cdb59711005f5732e7b6c08..38a67e5fed7cf96d65d9b30daae33b3db82ad0af 100644 (file)
@@ -30,7 +30,7 @@ struct Engraver_dispatch_entry
   Engraver_void_function_engraver_grob_info function_;
 };
 
-class Engraver_dispatch_list
+class Engraver_dispatch_list : public Simple_smob<Engraver_dispatch_list>
 {
   vector<Engraver_dispatch_entry> dispatch_entries_;
 public:
@@ -38,7 +38,6 @@ public:
   SCM static create (SCM trans_list,
                      SCM iface_list, Direction);
 
-  DECLARE_SIMPLE_SMOBS (Engraver_dispatch_list);
 };
 
 #endif /* TRANSLATOR_DISPATCH_LIST_HH */
index 0774930bf76663671d55934ef73e6fcdc6f094cd..17352269d980f7bfb38cdf04e8ed2d30952da10d 100644 (file)
@@ -47,8 +47,13 @@ struct Translator_method_binding
   }
 };
 
-class Translator_group
+class Translator_group : public Smob<Translator_group>
 {
+public:
+  static SCM mark_smob (SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static const char type_p_name_[];
+  virtual ~Translator_group ();
 private:
   void precompute_method_bindings ();
   vector<Translator_method_binding>
@@ -63,9 +68,7 @@ private:
 
 public:
   VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Translator_group);
-  DECLARE_SMOBS (Translator_group);
 
-public:
   virtual void connect_to_context (Context *c);
   virtual void disconnect_from_context ();
   virtual SCM get_simple_trans_list ();
index 0f8202e6be8dd7c2f10c0caf8edd664cc1c39fa9..31cbe0590d431984b5e20fd25ed9bb99665f8d5b 100644 (file)
@@ -117,8 +117,14 @@ enum Translator_precompute_index
 /*
   Translate music into grobs.
 */
-class Translator
+class Translator : public Smob<Translator>
 {
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+  virtual ~Translator ();
+private:
   void init ();
 
 public:
@@ -148,7 +154,6 @@ public:
   Global_context *get_global_context () const;
 
   TRANSLATOR_DECLARATIONS (Translator);
-  DECLARE_SMOBS (Translator);
 
 protected:                      // should be private.
   Context *daddy_context_;
index 07748ad48f5e4c9d4f270a04b540e32871deb942..420177e2d71bb92bba1afa63052636da70f69aac 100644 (file)
@@ -21,7 +21,6 @@
 #include "source-file.hh"
 #include "std-string.hh"
 
-#include "ly-smobs.icc"
 
 /* Dummy input location for use if real one is missing.  */
 Input dummy_input_global;
@@ -99,4 +98,3 @@ Input::unsmob (SCM s)
 }
 
 ADD_SCM_INIT_FUNC (input, start_input_smobs);
-
index 857aa6463fa93b97c5e74b69ed5e7f3bd6702c0d..921dd2ad7a488f4a8ab50b4d2592ca86b68d68ba 100644 (file)
@@ -364,11 +364,8 @@ Lily_lexer::add_lexed_char (int count)
   char_count_stack_.back () += count;
 }
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS (Lily_lexer);
-IMPLEMENT_TYPE_P (Lily_lexer, "ly:lily-lexer?");
-IMPLEMENT_DEFAULT_EQUAL_P (Lily_lexer);
+const char Lily_lexer::type_p_name_[] = "ly:lily-lexer?";
 
 SCM
 Lily_lexer::mark_smob (SCM s)
index 1cdd8d042969ca195d39bc95d265892c491afb86..b9100e123653fdf5f338f4127400cfa39ce53930 100644 (file)
@@ -37,7 +37,6 @@
 #include "warn.hh"
 #include "program-option.hh"
 
-#include "ly-smobs.icc"
 
 Lily_parser::Lily_parser (Sources *sources)
 {
@@ -211,9 +210,7 @@ Lily_parser::parser_error (Input const &i, const string &s)
   error_level_ = 1;
 }
 
-IMPLEMENT_SMOBS (Lily_parser);
-IMPLEMENT_TYPE_P (Lily_parser, "ly:lily-parser?");
-IMPLEMENT_DEFAULT_EQUAL_P (Lily_parser);
+const char Lily_parser::type_p_name_[] = "ly:lily-parser?";
 
 /****************************************************************
   OUTPUT-DEF
index cb966adc9a9c20e5b4117b7412c7340ec0b2073a..7dc4cc370c4f66cefe32449ef7331779cfdd4509 100644 (file)
@@ -18,7 +18,6 @@
 */
 
 #include "listener.hh"
-#include "ly-smobs.icc"
 #include "warn.hh"
 
 Listener::Listener ()
@@ -69,5 +68,4 @@ Listener::equal_p (SCM a, SCM b)
   return (*l1 == *l2) ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Listener);
-IMPLEMENT_TYPE_P (Listener, "ly:listener?");
+const char Listener::type_p_name_[] = "ly:listener?";
index adcecff767140095dd22e5fbb5aa3d8a5453fdb5..b1cf64969f6e9bd8c223b682677c08d90bf57eab 100644 (file)
@@ -43,16 +43,9 @@ Moment::Moment (Rational m)
   grace_part_ = Rational (0);
 }
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SIMPLE_SMOBS (Moment);
-IMPLEMENT_TYPE_P (Moment, "ly:moment?");
+const char Moment::type_p_name_[] = "ly:moment?";
 
-SCM
-Moment::mark_smob (SCM)
-{
-  return SCM_EOL;
-}
 
 int
 Moment::print_smob (SCM s, SCM port, scm_print_state *)
@@ -207,4 +200,3 @@ moment_less (SCM a, SCM b)
 {
   return *Moment::unsmob (a) < *Moment::unsmob (b);
 }
-
index 65fedab7ddd70380457a9fa1304176589749eb69..d519f862838a6ec533c8c48ffefc086b8228aac9 100644 (file)
 #include "music-function.hh"
 
 #include "music.hh"
-#include "ly-smobs.icc"
 
-class Musicfunction
+class Musicfunction : public Simple_smob<Musicfunction>
 {
-  DECLARE_SIMPLE_SMOBS (Musicfunction);
+public:
+  static SCM mark_smob (SCM);
+  static int print_smob (SCM, SCM, scm_print_state *);
+private:
   SCM signature_;
   SCM function_;
 public:
@@ -34,8 +36,6 @@ public:
   SCM get_signature () { return signature_; }
 };
 
-IMPLEMENT_SIMPLE_SMOBS (Musicfunction);
-IMPLEMENT_DEFAULT_EQUAL_P (Musicfunction);
 
 /* Print a textual represenation of the smob to a given port.  */
 int
index 009583d8e3dbb9a45c8b0750b6f364c354528ac8..3647d4dc46bbd95c2b35e45a87960d7232718bc4 100644 (file)
@@ -30,7 +30,6 @@ using namespace std;
 #include "music-wrapper-iterator.hh"
 #include "simple-music-iterator.hh"
 
-#include "ly-smobs.icc"
 
 Music_iterator::Music_iterator ()
 {
@@ -193,9 +192,7 @@ Music_iterator::get_music () const
 
 /****************************************************************/
 
-IMPLEMENT_TYPE_P (Music_iterator, "ly:iterator?");
-IMPLEMENT_SMOBS (Music_iterator);
-IMPLEMENT_DEFAULT_EQUAL_P (Music_iterator);
+const char Music_iterator::type_p_name_[] = "ly:iterator?";
 
 SCM
 Music_iterator::mark_smob (SCM smob)
index 438cddaaa9fa8021753f45603a5de87e6cbc7cc7..d0c08a118841d732269160cc98ed8eeb2995a360 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "music-output.hh"
 
-#include "ly-smobs.icc"
 
 Music_output::Music_output ()
 {
@@ -40,9 +39,7 @@ Music_output::derived_mark () const
 {
 }
 
-IMPLEMENT_SMOBS (Music_output);
-IMPLEMENT_DEFAULT_EQUAL_P (Music_output);
-IMPLEMENT_TYPE_P (Music_output, "ly:music-output?");
+const char Music_output::type_p_name_[] = "ly:music-output?";
 
 SCM
 Music_output::mark_smob (SCM s)
index 31bda8a26397208a73e711c911cfb3d67070475d..831e9f38053386dce96601f273337e7f7b0e96c6 100644 (file)
@@ -24,7 +24,6 @@
 #include "duration.hh"
 #include "input.hh"
 #include "international.hh"
-#include "ly-smobs.icc"
 #include "main.hh"
 #include "music-sequence.hh"
 #include "score.hh"
index 9c93dc68810907af158dc120a448637afa0c4f4c..ca0f7ad88a904000f658c7bb454d1c68f3a0b780 100644 (file)
@@ -29,7 +29,6 @@
 #include "scm-hash.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
 #include "program-option.hh"
 
@@ -61,8 +60,6 @@ Output_def::~Output_def ()
 {
 }
 
-IMPLEMENT_SMOBS (Output_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
 
 SCM
 Output_def::mark_smob (SCM m)
@@ -259,5 +256,3 @@ line_dimensions_int (Output_def *def, int n)
     : def->get_dimension (ly_symbol2scm ("indent"));
   return Interval (ind, lw);
 }
-
-
index aa66ee31eac75ed9a2f5272f42eaa670f31f7713..ba5342ab2bdb603d8b4cf53dca2adc25320c2b28 100644 (file)
@@ -18,7 +18,6 @@
 */
 
 #include "page-marker.hh"
-#include "ly-smobs.icc"
 
 Page_marker::Page_marker ()
 {
@@ -40,9 +39,7 @@ Page_marker::~Page_marker ()
 {
 }
 
-IMPLEMENT_SMOBS (Page_marker);
-IMPLEMENT_DEFAULT_EQUAL_P (Page_marker);
-IMPLEMENT_TYPE_P (Page_marker, "ly:page-marker?");
+const char Page_marker::type_p_name_[] = "ly:page-marker?";
 
 SCM
 Page_marker::mark_smob (SCM smob)
index fba89c2c83abf249666b15b8b82b64c1db393ae3..3a6d4b1074079b5d555551a3d65ed67364f02111 100644 (file)
@@ -31,7 +31,6 @@
 #include "program-option.hh"
 #include "page-marker.hh"
 
-#include "ly-smobs.icc"
 
 Paper_book::Paper_book ()
 {
@@ -52,9 +51,7 @@ Paper_book::~Paper_book ()
 {
 }
 
-IMPLEMENT_DEFAULT_EQUAL_P (Paper_book);
-IMPLEMENT_SMOBS (Paper_book);
-IMPLEMENT_TYPE_P (Paper_book, "ly:paper-book?");
+const char Paper_book::type_p_name_[] = "ly:paper-book?";
 
 SCM
 Paper_book::mark_smob (SCM smob)
index 6dff3242439bcc0c16ea0d5eabbe2fc532570f46..712c9c9bab71773e77dae2442cc031ee0772934c 100644 (file)
@@ -38,7 +38,6 @@ using namespace std;
 #include "string-convert.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
 Paper_outputter::Paper_outputter (SCM port, const string &format)
 {
@@ -61,8 +60,6 @@ Paper_outputter::~Paper_outputter ()
 {
 }
 
-IMPLEMENT_SMOBS (Paper_outputter);
-IMPLEMENT_DEFAULT_EQUAL_P (Paper_outputter);
 
 SCM
 Paper_outputter::mark_smob (SCM x)
index a030f1281cff3bf251001081b1f5a3103727d3da..8fd4d67171cc2cb5970c0a3fed5464e53f0d8602 100644 (file)
@@ -24,7 +24,6 @@
 #include "string-convert.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 #include <cmath>
 
 Pitch::Pitch (int o, int n, Rational a)
@@ -219,7 +218,7 @@ Pitch::down_to (int notename)
   notename_ = notename;
 }
 
-IMPLEMENT_TYPE_P (Pitch, "ly:pitch?");
+const char Pitch::type_p_name_[] = "ly:pitch?";
 SCM
 Pitch::mark_smob (SCM x)
 {
@@ -227,7 +226,6 @@ Pitch::mark_smob (SCM x)
   return p->scale_->self_scm ();
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Pitch);
 int
 Pitch::print_smob (SCM s, SCM port, scm_print_state *)
 {
index b5619fae66435745924076421c7c8095930bf1f3..bb679512d36c4879fa7ab7f52f023e98f76b3ec2 100644 (file)
 #include "input.hh"
 #include "profile.hh"
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS (Prob);
-IMPLEMENT_TYPE_P (Prob, "ly:prob?");
+const char Prob::type_p_name_[] = "ly:prob?";
 
 SCM
 Prob::equal_p (SCM sa, SCM sb)
@@ -198,4 +196,3 @@ Prob::name () const
   else
     return this->class_name ();
 }
-
index 3dff7b4b3320c6a2a654663b5f26ed047ab38c1f..8bdf02bdf002f185dbb29189dc271320101447bb 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "scale.hh"
 
-#include "ly-smobs.icc"
 
 /*
   todo: put string <-> pitch here too.
@@ -134,20 +133,7 @@ Scale::normalize_step (int step) const
   return ret;
 }
 
-int
-Scale::print_smob (SCM /* x */,
-                   SCM port,
-                   scm_print_state *)
-{
-  scm_puts ("#<Scale>", port);
-  return 1;
-}
 
-SCM
-Scale::mark_smob (SCM)
-{
-  return SCM_UNSPECIFIED;
-}
 
 Scale::Scale (vector<Rational> const &tones)
 {
@@ -165,6 +151,3 @@ Scale::Scale (Scale const &src)
 Scale::~Scale ()
 {
 }
-
-IMPLEMENT_SMOBS (Scale);
-IMPLEMENT_DEFAULT_EQUAL_P (Scale);
index 2388d4a88a103be474f080042752c772be54bdbb..2807cc4ad14ca7039685d8b39818f72225d70ae2 100644 (file)
@@ -26,8 +26,6 @@ Scheme_listener::call (SCM ev)
   scm_call_1 (callback_, ev);
 }
 
-IMPLEMENT_SMOBS (Scheme_listener);
-IMPLEMENT_DEFAULT_EQUAL_P (Scheme_listener);
 
 Scheme_listener::Scheme_listener (SCM c)
 {
index 83e937bc5890824afd286f0ec2ab9f7b78e7a6af..173dd49ccccfa661785b30e95b61e51aee7a76d6 100644 (file)
@@ -23,7 +23,6 @@
 #include <algorithm>
 using namespace std;
 
-#include "ly-smobs.icc"
 
 /*
   Return: number of objects.
@@ -147,6 +146,3 @@ Scheme_hash_table::to_alist () const
   return scm_internal_hash_fold ((scm_t_hash_fold_fn) &collect_handles,
                                  NULL, SCM_EOL, hash_tab_);
 }
-
-IMPLEMENT_SMOBS (Scheme_hash_table);
-IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table);
index 81477a118a49d2a2625e041debc0e743fbf5b44f..b5316954696a1dad0f0166c5a1ef90fd51f986fc 100644 (file)
@@ -36,7 +36,6 @@ using namespace std;
 #include "paper-score.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
 Input *
 Score::origin () const
@@ -60,9 +59,7 @@ Score::~Score ()
 {
 }
 
-IMPLEMENT_SMOBS (Score);
-IMPLEMENT_DEFAULT_EQUAL_P (Score);
-IMPLEMENT_TYPE_P (Score, "ly:score?");
+const char Score::type_p_name_[] = "ly:score?";
 
 SCM
 Score::mark_smob (SCM s)
index e21cbbf0ef7db494d40704cbf5db3b230ed55066..1f2f5aaa6ddbfd6e181e1ec73e6263b9f6d1492e 100644 (file)
@@ -534,22 +534,3 @@ get_line_configuration (vector<Grob *> const &columns,
 
   return ret;
 }
-
-#include "ly-smobs.icc"
-
-IMPLEMENT_SIMPLE_SMOBS (Simple_spacer);
-IMPLEMENT_DEFAULT_EQUAL_P (Simple_spacer);
-
-SCM
-Simple_spacer::mark_smob (SCM /* x */)
-{
-  return SCM_EOL;
-}
-
-int
-Simple_spacer::print_smob (SCM /* x */, SCM p, scm_print_state *)
-{
-  scm_puts ("#<Simple spacer>", p);
-  return 1;
-}
-
index d6bd5fb6fe085b475352c19c2f35d12e46558773..f95a5e7b74788fa6594881739843dc18369ca3f8 100644 (file)
@@ -21,7 +21,6 @@
 #include "skyline-pair.hh"
 
 #include "international.hh"
-#include "ly-smobs.icc"
 
 Skyline_pair::Skyline_pair ()
   : skylines_ (Skyline (DOWN), Skyline (UP))
@@ -128,15 +127,8 @@ Skyline_pair::operator [] (Direction d) const
   return skylines_[d];
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Skyline_pair);
-IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?");
-IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
+const char Skyline_pair::type_p_name_[] = "ly:skyline-pair?";
 
-SCM
-Skyline_pair::mark_smob (SCM)
-{
-  return SCM_EOL;
-}
 
 int
 Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *)
index 33d2823d47e0d752934558f75ea74e90e85ead41..6d6b58ca109d6d34cccc347d7d616cccddd743df 100644 (file)
@@ -22,7 +22,6 @@
 #include <deque>
 #include <cstdio>
 
-#include "ly-smobs.icc"
 
 /* A skyline is a sequence of non-overlapping buildings: something like
    this:
@@ -862,9 +861,7 @@ Skyline::clear ()
 
 /****************************************************************/
 
-IMPLEMENT_SIMPLE_SMOBS (Skyline);
-IMPLEMENT_TYPE_P (Skyline, "ly:skyline?");
-IMPLEMENT_DEFAULT_EQUAL_P (Skyline);
+const char Skyline::type_p_name_[] = "ly:skyline?";
 
 SCM
 Skyline::mark_smob (SCM s)
index d80704ae76dce99939e6e4c0ddfdb08d05f24f04..34f8c8b9c53d690c7caa3eb9ae2f8dbf6a851954 100644 (file)
@@ -358,11 +358,8 @@ Source_file::get_port () const
 
 /****************************************************************/
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS (Source_file);
-IMPLEMENT_DEFAULT_EQUAL_P (Source_file);
-IMPLEMENT_TYPE_P (Source_file, "ly:source-file?");
+const char Source_file::type_p_name_[] = "ly:source-file?";
 
 SCM
 Source_file::mark_smob (SCM smob)
@@ -384,4 +381,3 @@ Source_file::print_smob (SCM smob, SCM port, scm_print_state *)
   scm_puts (" >", port);
   return 1;
 }
-
index 5caa8e50628dd389c9859f81c22ab3a1b5e15d81..dd5b22be1ce9d4b5b6c6f74ea0dd3cc6eef0cc79 100644 (file)
 
 #include "spring.hh"
 #include "warn.hh"
-#include "ly-smobs.icc"
 
-IMPLEMENT_SIMPLE_SMOBS (Spring);
 
-SCM
-Spring::mark_smob (SCM)
-{
-  return SCM_UNSPECIFIED;
-}
 
-int
-Spring::print_smob (SCM, SCM p, scm_print_state *)
-{
-  scm_puts ("#<Spring smob>", p);
-  return 1;
-}
 
 SCM
 Spring::equal_p (SCM a, SCM b)
@@ -79,4 +66,4 @@ LY_DEFINE (ly_spring_set_inverse_stretch_strength_x, "ly:spring-set-inverse-stre
   return s->smobbed_copy ();
 }
 
-IMPLEMENT_TYPE_P (Spring, "ly:spring?");
+const char Spring::type_p_name_[] = "ly:spring?";
index 51f051d597f3588e954db618928d7f734173e77e..20c81bedfddaf8be1b35fde83f1e099d40189db2 100644 (file)
@@ -25,7 +25,6 @@
 #include "string-convert.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
 
 Stencil::Stencil ()
 {
@@ -54,9 +53,7 @@ Stencil::mark_smob (SCM smob)
   return s->expr_;
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Stencil);
-IMPLEMENT_TYPE_P (Stencil, "ly:stencil?");
-IMPLEMENT_DEFAULT_EQUAL_P (Stencil);
+const char Stencil::type_p_name_[] = "ly:stencil?";
 
 Interval
 Stencil::extent (Axis a) const
index f8c9f8fc8b619235eb78baa87cf314a5381ac163..3af222c1c7550d4c27830c3f793f9f63e4f5cf96 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "stream-event.hh"
 
-#include "ly-smobs.icc"
 #include "context.hh"
 #include "input.hh"
 #include "music.hh"
index 873f707de5d06b83cd529cab0c6d6e6a2019cd83..4faac7116781bd08bf7abe3e83ca7042c62fc474 100644 (file)
@@ -20,7 +20,6 @@
 #include "translator-dispatch-list.hh"
 #include "engraver.hh"
 
-#include "ly-smobs.icc"
 
 void
 Engraver_dispatch_list::apply (Grob_info gi)
@@ -72,21 +71,3 @@ Engraver_dispatch_list::create (SCM trans_list,
 
   return found ? retval : SCM_EOL;
 }
-
-SCM
-Engraver_dispatch_list::mark_smob (SCM)
-{
-  return SCM_BOOL_F;
-}
-
-int
-Engraver_dispatch_list::print_smob (SCM /* x */,
-                                    SCM p,
-                                    scm_print_state *)
-{
-  scm_puts ("#<Engraver_dispatch_list>", p);
-  return 1;
-}
-
-IMPLEMENT_SIMPLE_SMOBS (Engraver_dispatch_list);
-IMPLEMENT_DEFAULT_EQUAL_P (Engraver_dispatch_list);
index 3f7e129602d7e2480edede441d679a64838bee20..23aae462e55a14d1e03831c6ed4d4872b48cbd0b 100644 (file)
@@ -343,11 +343,8 @@ Translator_group::~Translator_group ()
 {
 }
 
-#include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS (Translator_group);
-IMPLEMENT_DEFAULT_EQUAL_P (Translator_group);
-IMPLEMENT_TYPE_P (Translator_group, "ly:translator-group?");
+const char Translator_group::type_p_name_[] = "ly:translator-group?";
 
 int
 Translator_group::print_smob (SCM s, SCM port, scm_print_state *)
index 5f4a39bb0ea835121527082d9717c7b849a68c13..e48b8956cfe08bddef879b2b830503a3e733c541 100644 (file)
@@ -27,7 +27,6 @@
 #include "warn.hh"
 
 #include "translator.icc"
-#include "ly-smobs.icc"
 
 Translator::~Translator ()
 {
@@ -219,9 +218,7 @@ Translator::get_score_context () const
   return daddy_context_->get_score_context ();
 }
 
-IMPLEMENT_SMOBS (Translator);
-IMPLEMENT_DEFAULT_EQUAL_P (Translator);
-IMPLEMENT_TYPE_P (Translator, "ly:translator?");
+const char Translator::type_p_name_[] = "ly:translator?";
 
 bool
 Translator::must_be_last () const
index a43d46d21ca8cc392cc675fd16f0632706dd28a2..33d5ed545523059a5fc78af38b32a853ae1a29cd 100644 (file)
 */
 
 #include "smobs.hh"
-#include "ly-smobs.icc"
 
-class Undead
+class Undead : public Simple_smob<Undead>
 {
-  DECLARE_SIMPLE_SMOBS (Undead);
+public:
+  static int print_smob (SCM, SCM, scm_print_state *);
+  static SCM mark_smob (SCM);
+  static const char type_p_name_[];
+private:
   SCM object_;
 public:
   SCM object () { return object_; }
@@ -50,9 +53,7 @@ Undead::print_smob (SCM undead,
   return 1;
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Undead);
-IMPLEMENT_DEFAULT_EQUAL_P (Undead);
-IMPLEMENT_TYPE_P (Undead, "ly:undead?");
+const char Undead::type_p_name_[] = "ly:undead?";
 
 LY_DEFINE (ly_make_undead, "ly:make-undead",
            1, 0, 0, (SCM object),