source file of the GNU LilyPond music typesetter
- (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "input.hh"
#include "smobs.hh"
-#define get_property(x) internal_get_property(ly_symbol2scm(x))
-
+/* copied from lily-guile.hh */
+#ifndef get_property
+#define get_property(x) internal_get_property (ly_symbol2scm (x))
+#endif
#define TRANSLATOR_DECLARATIONS(NAME) \
public: \
- NAME();\
- VIRTUAL_COPY_CONS (Translator); \
+ NAME (); \
+ VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME); \
static SCM static_description_; \
virtual SCM static_translator_description () const; \
virtual SCM translator_description () const;
class Translator
{
void init ();
+
+protected:
+ bool must_be_last_;
+
public:
- Music_output_def * output_def_;
+ bool must_be_last () const;
- bool is_alias_b (SCM) const;
- Translator (Translator const &);
-
+ Context * context () const { return daddy_context_; }
- Translator_group * daddy_trans_ ;
- void removal_processing ();
- /**
- ask daddy for a feature
- */
- Music_output_def *get_output_def () const;
+ Translator (Translator const &);
SCM internal_get_property (SCM symbol) const;
+ virtual Output_def *get_output_def () const;
+ virtual Translator_group* get_daddy_translator ()const;
virtual Moment now_mom () const;
-
- /*
- ugh: bubbled up from Translator_group.
- */
- SCM simple_trans_list_;
- SCM trans_group_list_;
- SCM definition_;
- SCM properties_scm_;
- DECLARE_SMOBS (Translator, dummy);
-
-
-public:
- Global_translator * top_translator () const;
- TRANSLATOR_DECLARATIONS(Translator);
virtual bool try_music (Music *req);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- virtual void do_announces () ;
virtual void initialize () ;
+ virtual void process_music ();
+ virtual void do_announces ();
virtual void finalize ();
-};
+
+ Score_context * get_score_context () const;
+ Global_context * get_global_context () const;
+
+ TRANSLATOR_DECLARATIONS(Translator);
+ DECLARE_SMOBS (Translator, dummy);
+protected: // should be private.
+ Context * daddy_context_ ;
+ SCM simple_trans_list_;
+ friend class Context_def;
+ friend class Context;
+};
/**
A macro to automate administration of translators.
void add_translator (Translator*trans);
-Translator*get_translator (String s);
+Translator*get_translator (SCM s);
DECLARE_UNSMOB(Translator,translator);
#endif // TRANSLATOR_HH