return b->scores_;
}
-#include "ly-smobs.icc"
-IMPLEMENT_TYPE_P (Book, "ly:book?");
+const char Book::type_p_name_[] = "ly:book?";
#include "paper-score.hh"
#include "page-marker.hh"
-#include "ly-smobs.icc"
Book::Book ()
{
{
}
-IMPLEMENT_SMOBS (Book);
-IMPLEMENT_DEFAULT_EQUAL_P (Book);
SCM
Book::mark_smob (SCM s)
/****************************************************************/
-#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?";
{
}
-#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 *)
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 *)
{
return scm_reverse (mods_);
}
-
|| 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
// 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)
#include "dispatcher.hh"
#include "global-context.hh"
#include "international.hh"
-#include "ly-smobs.icc"
#include "main.hh"
#include "output-def.hh"
#include "profile.hh"
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
#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 ()
{
#include "misc.hh"
#include "lily-proto.hh"
-#include "ly-smobs.icc"
int
Duration::compare (Duration const &left, Duration const &right)
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 *)
{
#include "stencil.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
Real
Font_metric::design_size () const
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
#include "item.hh"
#include "spanner.hh"
-#include "ly-smobs.icc"
Item *
Grob_array::item (vsize i)
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)
#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)
#include "unpure-pure-container.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
Grob *
Grob::clone () const
#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_;
#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]; }
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
void apply_default_property_operations (Context *);
private:
- DECLARE_SMOBS (Context_def);
Context_def ();
Context_def (Context_def const &);
};
#endif /* CONTEXT_DEF_HH */
-
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:
Context_mod ();
Context_mod (Context_mod const &);
Context_mod (SCM mod_list);
- DECLARE_SIMPLE_SMOBS (Context_mod);
};
#endif /* CONTEXT_MOD_HH */
-
#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 ();
#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
void remove_listener (Listener, SCM event_class);
void register_as_listener (Dispatcher *dist);
void unregister_as_listener (Dispatcher *dist);
-protected:
- DECLARE_SMOBS (Dispatcher);
};
/**
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);
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.
extern SCM Duration_type_p_proc;
#endif // DURATION_HH
-
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:
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. */
#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:
SCM grob_array_to_list (Grob_array *array);
#endif /* GROB_ARRAY_HH */
-
#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 ();
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&);
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_;
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:
&& (*type_->equal_callback) ((void *) target_, (void *) other.target_);
}
- DECLARE_SIMPLE_SMOBS (Listener);
};
#define IMPLEMENT_LISTENER(cl, method) \
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);
bool moment_less (SCM a, SCM b);
#endif /* MOMENT_HH */
-
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:
#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 ();
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_;
#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) */
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_;
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);
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_;
string to_string () const;
DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
- DECLARE_SIMPLE_SMOBS (Pitch);
};
enum
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 ();
#include "rational.hh"
#include "std-vector.hh"
-struct Scale
+struct Scale : public Smob<Scale>
{
-public:
+ virtual ~Scale ();
Scale (vector<Rational> const &);
Scale (Scale const &);
int step_count () const;
int normalize_step (int step) const;
- DECLARE_SMOBS (Scale);
private:
vector<Rational> step_tones_;
extern Scale *default_global_scale;
#endif /* SCALE_HH */
-
#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_;
};
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);
private:
SCM hash_tab_;
void copy (Scheme_hash_table const &src);
- DECLARE_SMOBS (Scheme_hash_table);
};
#endif /* SCM_HASH_HH */
-
#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_;
#include "spring.hh"
#include "smobs.hh"
-class Simple_spacer
+class Simple_spacer : public Simple_smob<Simple_spacer>
{
public:
Simple_spacer ();
Real force_penalty (bool ragged) const;
bool fits () const;
- DECLARE_SIMPLE_SMOBS (Simple_spacer);
private:
Real expand_line ();
bool ragged);
#endif /* SIMPLE_SPACER_HH */
-
#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);
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_;
Real internal_distance (Skyline const &, Real *touch_point) const;
void normalize ();
- DECLARE_SIMPLE_SMOBS (Skyline);
public:
Skyline ();
extern bool debug_skylines;
#endif /* SKYLINE_HH */
-
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_;
void init_port ();
void init ();
- DECLARE_SMOBS (Source_file);
public:
Source_file (const string &fn);
Source_file (const string&, const string&);
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;
vector<char> gulp_file (const string &fn, int desired);
#endif /* SOURCE_FILE_HH */
-
#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_;
void update_blocking_force ();
- DECLARE_SIMPLE_SMOBS (Spring);
public:
Spring ();
Spring (Real distance, Real min_distance);
Spring merge_springs (vector<Spring> const &springs);
#endif /* SPRING_HH */
-
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 ();
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:
SCM static create (SCM trans_list,
SCM iface_list, Direction);
- DECLARE_SIMPLE_SMOBS (Engraver_dispatch_list);
};
#endif /* TRANSLATOR_DISPATCH_LIST_HH */
}
};
-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>
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 ();
/*
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:
Global_context *get_global_context () const;
TRANSLATOR_DECLARATIONS (Translator);
- DECLARE_SMOBS (Translator);
protected: // should be private.
Context *daddy_context_;
#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;
}
ADD_SCM_INIT_FUNC (input, start_input_smobs);
-
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)
#include "warn.hh"
#include "program-option.hh"
-#include "ly-smobs.icc"
Lily_parser::Lily_parser (Sources *sources)
{
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
*/
#include "listener.hh"
-#include "ly-smobs.icc"
#include "warn.hh"
Listener::Listener ()
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?";
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 *)
{
return *Moment::unsmob (a) < *Moment::unsmob (b);
}
-
#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:
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
#include "music-wrapper-iterator.hh"
#include "simple-music-iterator.hh"
-#include "ly-smobs.icc"
Music_iterator::Music_iterator ()
{
/****************************************************************/
-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)
#include "music-output.hh"
-#include "ly-smobs.icc"
Music_output::Music_output ()
{
{
}
-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)
#include "duration.hh"
#include "input.hh"
#include "international.hh"
-#include "ly-smobs.icc"
#include "main.hh"
#include "music-sequence.hh"
#include "score.hh"
#include "scm-hash.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
#include "program-option.hh"
{
}
-IMPLEMENT_SMOBS (Output_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
SCM
Output_def::mark_smob (SCM m)
: def->get_dimension (ly_symbol2scm ("indent"));
return Interval (ind, lw);
}
-
-
*/
#include "page-marker.hh"
-#include "ly-smobs.icc"
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)
#include "program-option.hh"
#include "page-marker.hh"
-#include "ly-smobs.icc"
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)
#include "string-convert.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
Paper_outputter::Paper_outputter (SCM port, const string &format)
{
{
}
-IMPLEMENT_SMOBS (Paper_outputter);
-IMPLEMENT_DEFAULT_EQUAL_P (Paper_outputter);
SCM
Paper_outputter::mark_smob (SCM x)
#include "string-convert.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
#include <cmath>
Pitch::Pitch (int o, int n, Rational a)
notename_ = notename;
}
-IMPLEMENT_TYPE_P (Pitch, "ly:pitch?");
+const char Pitch::type_p_name_[] = "ly:pitch?";
SCM
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 *)
{
#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)
else
return this->class_name ();
}
-
#include "scale.hh"
-#include "ly-smobs.icc"
/*
todo: put string <-> pitch here too.
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)
{
Scale::~Scale ()
{
}
-
-IMPLEMENT_SMOBS (Scale);
-IMPLEMENT_DEFAULT_EQUAL_P (Scale);
scm_call_1 (callback_, ev);
}
-IMPLEMENT_SMOBS (Scheme_listener);
-IMPLEMENT_DEFAULT_EQUAL_P (Scheme_listener);
Scheme_listener::Scheme_listener (SCM c)
{
#include <algorithm>
using namespace std;
-#include "ly-smobs.icc"
/*
Return: number of objects.
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);
#include "paper-score.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
Input *
Score::origin () const
{
}
-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)
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;
-}
-
#include "skyline-pair.hh"
#include "international.hh"
-#include "ly-smobs.icc"
Skyline_pair::Skyline_pair ()
: skylines_ (Skyline (DOWN), Skyline (UP))
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 *)
#include <deque>
#include <cstdio>
-#include "ly-smobs.icc"
/* A skyline is a sequence of non-overlapping buildings: something like
this:
/****************************************************************/
-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)
/****************************************************************/
-#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)
scm_puts (" >", port);
return 1;
}
-
#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)
return s->smobbed_copy ();
}
-IMPLEMENT_TYPE_P (Spring, "ly:spring?");
+const char Spring::type_p_name_[] = "ly:spring?";
#include "string-convert.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
Stencil::Stencil ()
{
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
#include "stream-event.hh"
-#include "ly-smobs.icc"
#include "context.hh"
#include "input.hh"
#include "music.hh"
#include "translator-dispatch-list.hh"
#include "engraver.hh"
-#include "ly-smobs.icc"
void
Engraver_dispatch_list::apply (Grob_info gi)
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);
{
}
-#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 *)
#include "warn.hh"
#include "translator.icc"
-#include "ly-smobs.icc"
Translator::~Translator ()
{
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
*/
#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_; }
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),